Fix deadlock with waffle flags and cachable user queries

Django 1.5 allows for custom user models. In one project of mine, those
custom user models are cached using django-cache-machine, so any M2M
query is automatically read from the cache.

However, in waffle.cache_flag, there's a problem where
<flag>.users.all() is evaluated within the LocMem cache's write lock
established by cache.add(). Because the User object is cached,
users.all() attempt to lock the same lock for reading, which isn't
possible within the write lock. So the code deadlocks.

The fix is to ensure that users.all() is evaluated *outside* the write
lock. I included groups in this as well even though I don't use them
currently.