Unit tests would fail if compiled with -DDEBUG_LOCKORDER (AssertLockHeld() would fail; AssertLockHeld() relies on the DEBUG_LOCKORDER code to keep track of locks held).
Fixed by LOCK'ing the wallet mutex in the unit tests that manipulate the wallet.
This only changes the unit tests, so I plan on pulling as soon as pull-tester is happy.