Check for pending schedules AFTER setting the trigger event.

The bug this fixes is hard to detect on modern hardware unless it is
under partiularly high load that presumably causes wonky VM scheduling.

The inner-most signal_pending() test was thought to be unneeded but
testing shows it is entirely necessary.  The hypothesis is this might be
due to a bug in Xen (4.3.2) or an intentional (bad) behavior in which
Xen delivers signals when particular hypercalls are observed.