Support PHP versions < 5.3

PHP 5.3 introduced pcntl_signal_dispatch().  To support signal handling in versions less than 5.3, we need to use ticks.  I've done so by wrapping the sleep call in a ticks block.  This ensures that the signal handlers only get called after the sleep and not while a job is executing.