FIX: OS X libc produces a EDEADLK instead of EBUSY
Merge pull request #323 from reneme/fix_write_lock_test

FIX: OS X Produces a EDEADLK Instead of EBUSY