Current switching by conformational change in a π-σ-π molecular wire