Put get_lock() as Base methode, rename it to lock.

Also change the unit test accordinhly.
Improve Base.lock() by providing info on BusyError
Fix deadlock when using lock() down the call stack

Previously, if a process needed to call lock() inside locked context it will result in a deadlock. (c.f. comment on commit 19f402a5f).
This commit fixes the deadlock problem by allowing a re-entering thread to not need to acquire the lock.
Add base.lock() inside StoredTrace.post_graph