Fix not to be round down to zero
Refactor timer logic

Task.DONE is changed from -1 to Long.MAX_VALUE, so Long.MAX is a
special value which means the task is done. If the result of the
task is positive but not Long.MAX_VALUE, the task is retried with
delay determined by the result. If zero or negative, retried
in the next round.

Lock of the DefaultTaskLoop is replaced to synchronized to
simplify logic.
Add guard not to call wakeup() more than enough