Fix a crash with multi-threaded applications using the FIPS module