PYTHON-1147 - Make sockets non-inheritable if possible
PYTHON-1147 - Make sockets non-inheritable if possible

This change attempts to set the close-on-exec flag on
sockets when possible. If socket.SOCK_CLOEXEC is defined
we attempt to use it, otherwise we fall back to fcntl. If
fcntl isn't available (Windows and various other platforms)
there isn't anything we can do.

Note that using fcntl is *not* atomic. It's possible that a socket
can be created and fork + execv can happen before the call to
fcntl, leaking the file descriptor anyway. CPython 3.4 implements
PEP 446, making all newly created file descriptors non-inheritable
by default. If your application needs the behavior this change
attempts to provide you should really use CPython 3.4+.

Note also, this change *does not* make PyMongo fork safe.

aherlihy/mongo-python-driver,mongodb/mongo-python-driver,ramnes/mongo-python-driver,ShaneHarvey/mongo-python-driver,mongodb/mongo-python-driver,mongodb/mongo-python-driver,ShaneHarvey/mongo-python-driver,aherlihy/mongo-python-driver,ramnes/mongo-python-driver,ShaneHarvey/mongo-python-driver,ramnes/mongo-python-driver,aherlihy/mongo-python-driver