fix for Mac OS X: don't select on invalid fds