reading/writing blocking FDs over FD_SETSIZE is broken (Partially Trac #9168)

Summary:
libraries/base/cbits/inputReady.c had no limits on file descriptors.
Add a limit as non-threaded RTS does.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: none

Reviewers: austin, simonmar

Reviewed By: austin, simonmar

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D28

(cherry picked from commit b0316cdb10fbd9eaca7ede28c7bb3eb19f7766bf)