sigwait race fix