Don't use mock.patch to disable backdrop connect

mock.patch depends on how the code being patched imports the function
being patched. That means patching is not a  reliable way of disabling calls
to that function.

Although globals are horrid and are definitely not thread safe, I
believe this is the best way to achieve the disabling functionality.