Common sense leads me to think that a close() should release
threads in IO operations (reads/writes/selects/polls) and
return EBADF or something appropriate. At least when behavior
is not dictated by POSIX or other historical/defactor behavior.
BTW, I tested the behavior on Solaris. Solaris returns EBADF
with the posted sample C program.