Fix timeout setting when it is zero.

In particular, this bug caused the checker to fail when it required
more time than the task timeout.