Fix issue with Django 1.6 query.is_empty() on older versions