calculate timeout independent of storage backend

Previously, the cache timeout was only calculated for tiles stored in
files, this patch brings the calculation forward as it is useful for all
storage backends.
Don't load expired tiles from sqlite DB

Some layers, such as the Google traffic layer change frequently and it
mostly doesn't make sense to retrieve them from cache after a
configurable timeout.

This change checks the age of cached data stored in sqlite DB against
the configured timeout and doesn't return them if they are older.