Fixed searchByMime in shared cache

- searchByMime now correctly returns files recursively search through
  all the dirs
- added unit test for searchByMime
- fixes #6496

Note: this is not a "full fix" of the search code as the "full fix" requires some refactoring to be done in the sharing API to allow "where" clauses from outside.
Also, didn't want to add a "where" clause to the `getFolderContents()` yet to prevent API changes.

So this is a "quick fix" which should be suitable for backporting.

Please review @karlitschek @schiesbn @icewind1991 @butonic @DeepDiver1975