[ticket/11305] Check for $cache being null before using it in db drivers.

There is no reason why db drivers must have a cache to work.
They query the database, that part works without caches.

PHPBB3-11305