M2M __in filtering after a Count annotation

See [ticket#24039](https://code.djangoproject.com/ticket/24039)

After annotating and filtering a queryset for the number of m2m related objects, subsequent filters using `__in` falsely return an empty result.

In this PR, the first test passes to demonstrate the expected behavior.  The following test—which is really the same logic as the first test, only written differently—fails.

Also see some pdb output from my personal project to show this in action: http://dpaste.com/3JQYWTZ#line-31

Specifically, **it is the annotated _filter_ that triggers the bug**.

Consider this output:

```python
>>> annotated_query = Book.objects.annotate(c=Count('authors'))
>>> annotated_query.filter(authors=author1).filter(authors=author2).filter(authors=author3)
[<Book: Python Web Development with Django>]
>>> annotated_query.filter(authors__in=[author1, author2, author3])
[<Book: Python Web Development with Django>]
```

versus this output with the annotated filter:

```python
>>> annotated_query = Book.objects.annotate(c=Count('authors')).filter(c=3)
>>> annotated_query.filter(authors=author1).filter(authors=author2).filter(authors=author3)
[<Book: Python Web Development with Django>]
>>> annotated_query.filter(authors__in=[author1, author2, author3])
[]
```