If compiled -DDEBUG_LOCKORDER and run with -debug, print out every mutex lock/unlock (helpful for debugging something-is-holding-a-mutex-too-long problems)

Backported from bitcoin commit c591cc50eb126eddc78525dd386ea98abaaed724