Fix build with -DDO_NOT_USE_MUTEX=ON.