locking: implement and test ProcessLock class.

The main piece to replace the current locking mechanisms from Yum.
locking: remove the old global locking code.

manage things smartly in main.py
locking: as an example introduce rpmdb_lock and metadata_cache_lock.

This is the plan of how things are going to be locked granularly: those system
objects that need exclusive access for some period are locked for that time, but
DNF as a whole doesn't need a global lock.