add a ALLWAYS_JOIN_THREADS_BEFORE_FORK preprocessor flag to help debug locking problems