Fix for #3623

Make sure that the imported qt backend is consistent with selected backend. Otherwise the combination of the ETS env variable and a selected backend can result in matplotlib importing PyQt4 and using it inside the qt5 backend and vice versa resulting in bugs such as #3623