base: Fix hWaitForInput with timeout on POSIX