Fix the issue with the static mutex destruction.