Enumerable.matching_document _unloaded double query fix

After debugging #2761, I realize that has_and_belongs_to_many were querying the DB twice with the same selector.

When there was a many to many, and the target was not loaded and target.first was called, _unloaded was calling the db twice in order to load.