Set the given file descriptor to non-blocking mode.

def set_nonblock(fd):
    # type: (int) -> None
    """Set the given file descriptor to non-blocking mode."""
    fcntl.fcntl(fd,
                fcntl.F_SETFL,
                fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)