Nonadiabatic molecular orientation by polarization-gated ultrashort laser pulses