libgimpbase, app: move gimp_file_has_extension() to libgimpbase

and use it in GimpModuleDB.