unix: sanity-check fds before closing

RFC from @piscisaureus and @saghul.

The idea is to catch a pretty common type of error that we have in node.js, namely closing stdio file descriptors.

It also ties in with joyent/node#6271 where libuv triggers a Linux kernel bug that results in a busy loop.