Fix wrong thread id when raising BusyError
Small comestic fix when checking resource in lock
Unit tests: clean up Base lock, add Model lock
Small fix for badly reporting blocking thread id
Add unit tests for Method and Trace locking