Fix: poll_wait segment fault