Set only the client socket in non-blocking mode instead of all fds; should avoid problems with stdio handles.