[qtbase] Backport QWindow::close() fixes from Qt 5.4