Fixed Metadata test hang.

Because testMetadataThreading() emits metadata changed signals on arbitrary threads, if any python slots happen to be connected, they must acquire the GIL. Therefore we must release the GIL before running the test. This problem didn't present itself when running the tests in isolation because no slots are connected then, but if run in a scenario where a slot was connected, the problem would become apparent.
Fixed "KeyError: 'currentTab'" error when loading custom layouts.