pluginmanager: always return valid mimetypes
This fixes a small regression introduced by 1b817f61. Previously PluginManager would always return a list of *valid* mimetypes, because sortByComment() was filtering out invalid ones. After commit 1b817f61 sortByComment() is no longer unconditionally called, so the check for valid mimetypes needs to be moved. This was causing createdialogtest and adddialogtest to fail on the CI.