the asynchronous close functionality required on Linux/BSD oses is not working on Mac OS X yet. There are a few problems
1. The bsd_close.c code is not compiled in due to missing macro in net_util_md.h
2. NET_Accept is not using the BLOCKING macro
3. Interestingly, pthread mutexes must be explicitly initialized on Macosx and our code was not checking
the return code of pthread_mutex_lock() which was failing silently and therefore not synchronising
properly and causing actual memory corruption and crashes.