Re-enabled read locks

The part that needed fixing for the tests was that some 'switch' commands
were keeping a global lock for package installs. They now properly relax to
a switch lock once the global operations are done, before getting to package
installs