Implements poll() via select() for certain programs like OpenSSH which need it. (This implementation is actually based OpenSSHp's compat function.)