[ticket/9781] Disable search results caching if caching is actually disabled

https://tracker.phpbb.com/browse/PHPBB3-9781
Yeah, that shouldn't have happened.. :D I don't know how it found its way in the commit. ^^