Fixed searchByMime in shared cache

- searchByMime now correctly returns files recursively search through
  all the dirs
- added unit test for searchByMime

Backport of fa5ddc3 to stable6