Fixes non-closing open file window…

…by loading the realm asynchronously, and not relying on there being a realm when the different windows awake.