Add a lock for when the process forks

Deadlocks were occuring with DNS lookups because of the following case:

"The non-obvious problem in this approach is that at the moment of the
fork(2) call some threads may be in critical sections of code, doing
non-atomic operations protected by mutexes. In the child process the
threads just disappears and left data half-modified without any
possibility to "fix" them, there is no way to say what other threads
were doing and what should be done to make the data consistent.
Moreover: state of mutexes is undefined, they might be unusable and the
only way to use them in the child is to call pthread_mutex_init() to
reset them to a usable state. It's implementation dependent how mutexes
behave after fork(2) was called. On my Linux machine locked mutexes are
locked in the child."
[1] http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them
It would be process-global, either at the CPython level:
https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L5327
or at the system level:
http://code.woboq.org/userspace/glibc/sysdeps/unix/sysv/linux/check_pf.c.html#347

    #0  __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
    #1  0x00007fd4f14fb5dd in _L_lock_820 () from /lib/x86_64-linux-gnu/libc.so.6
    #2  0x00007fd4f14fb395 in __check_pf (seen_ipv4=0x7fd4f17a6134 <lock>, seen_ipv4@entry=0x7fff3519da70, seen_ipv6=seen_ipv6@entry=0x7fff3519da80, in6ai=in6ai@entry=0x7fff3519dab0, in6ailen=0xffffffffffffffff, in6ailen@entry=0x7fff3519dac0)
        at ../sysdeps/unix/sysv/linux/check_pf.c:319
    #3  0x00007fd4f14b3159 in __GI_getaddrinfo (name=name@entry=0x7fd4f1a824d4 "example.com", service=service@entry=0x7fff3519dc70 "80", hints=<optimized out>, hints@entry=0x7fff3519dc90, pai=pai@entry=0x7fff3519dc40)
        at ../sysdeps/posix/getaddrinfo.c:2458
    #4  0x000000000058d709 in socket_getaddrinfo.68247 (self=<optimized out>, args=<optimized out>) at ../Modules/socketmodule.c:4201