Make the libevent mutex debugging code thread-safe.