Fixed #21563 -- Single related object descriptors should work with `hasattr`.

Thanks to Aymeric Augustin for the review and Trac alias monkut for the report.