The main window should grab focus immediately

Otherwise key inputs could be wrongly sent to the active window until the data
is fully loaded.