Fixing deadlock in switch_manager. fixes #16
Fixed invalid lock release. Adding some comments. fixes #16
Merge branch 'devel0.4/fix_deadlock_swmgr' into devel-0.4