Unit test fixes for AssertLockHeld / -DDEBUG_LOCKORDER

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.
Merge pull request #3578 from gavinandresen/unittest_debuglockorder

Unit test fixes for AssertLockHeld / -DDEBUG_LOCKORDER