fixed the issue of control connection querying different hosts + improved lock syntax throughout the code
switched to recursive_lock in session objects to avoid multiple locks of the same mutex