Fix mutex debug mode

- Add debug function to header
- Add explicit debug mode set to non-debug constructor