Convert an isinstance() back to a type()

This reverts one line of 673e5dd.  Previously it was checking if the type() of
something was QuerySet (and erroring if so).  The change caused it to error on
*any* instance of QuerySet, including for example a ValuesListQuerySet.  This broke some (or all?) ajax autocompletes.

It may be worth a more careful look over #1411 to make sure no other similar issues were introduced.
I agree that a comment or docstring would be useful, but I didn't write the code, so I have no clue if that's the actual intent.  Given that checking `type()` doesn't seem to be causing any problems, I'm inclined to leave it unless you or someone else wants to do put in more work and test more carefully.