Fixed #17001 - WIP to allow usage of custom querysets in prefetch_related.