Fixed #23795 -- Fixed a regression in custom form fields

Custom form fields having a `queryset` attribute but no
`limit_choices_to` could no longer be used in ModelForms.

Refs #2445.

Thanks to @artscoop for the report.
Is `and hasattr(formfield, 'limit_choices_to')` required to make the test pass? It seems like `get_limit_choices_to` would may be the better attribute to check since that's what's actually called?