rework psync_timer_wait_next_sec, hopefully will not crash on Win