sched_thread.c: calculate next_call_time correctly