[1.6.x] Fixed an ImportError in `django.core.cache.backends.db`

It was introduced by a979a2fea5.