Controlling the orientation of polar molecules by half-cycle pulses