Transition to shear banding in pipe and Couette flow of wormlike micellar solutions