[MAJOR] fixed some expiration dates on tasks

The time subsystem really needs fixing. It was still possible
that some tasks with expiration date below the millisecond in
the future caused busy loop around poll() waiting for the
timeout to happen.
diff --git a/src/task.c b/src/task.c
index d236d9f..8905581 100644
--- a/src/task.c
+++ b/src/task.c
@@ -88,6 +88,7 @@
  */
 int wake_expired_tasks()
 {
+	__label__ out;
 	int slen;
 	struct task *task;
 	void *data;
@@ -100,8 +101,10 @@
 
 	if (likely(timer_wq.data != NULL)) {
 		task = LIST_ELEM(timer_wq.data, struct task *, qlist);
-		if (likely(__tv_isge(&task->expire, &now) > 0))
-			return tv_ms_remain(&now, &task->expire);
+		if (likely(__tv_isge(&task->expire, &now) > 0)) {
+			next_time = tv_ms_remain(&now, &task->expire);
+			goto out;
+		}
 	}
 
 	/* OK we lose. Let's scan the tree then. */
@@ -127,6 +130,10 @@
 			task->state = TASK_RUNNING;
 		}
 	}
+ out:
+	/* Ensure that we don't report sub-millisecond timeouts */
+	if (next_time != TIME_ETERNITY)
+		next_time++;
 	return next_time;
 }