sched/wait: Change timeout logic