Add a helper function to make fd nonblock.