Fix nasty bug in pg.bufferPulse

Pulse turn offs were being ignored because the diff() of a uint vector
cannot be negative. Furthermore, we were not properly handling the case
of just two marker pulses.
--BRJ