Terminate the app after the last window was closed.