src/socket_wrapper.c: fix mutex fork handling