When closing QuickFix window and it is the current window, try to go back to the previous window.