kernel: Check the timeout before queuing the interrupt

While Phexample was ported we noticed that the interrupt was queued
long after the Delay has stopped and the process continued. The process
was interrupted at the wrong point. Check the timeout variable to
see if the normal process continued to execute.

I think the race-free operation should make sure that the process
can't wake up if it is still sleeping, then check sem and then
schedule the interrupt and resume the process (if needed).

2014-01-24  Paolo Bonzini  <bonzini@redhat.com>

	* kernel/Delay.st: Check the Semaphore before queuing the
	interrupt for the target process.