Revert "Revert backporting 'Dexterity support for the related items viewlet."

This reverts commit 614973c6e4cdef78e7dc6ab29d4c26ea35d7a915.
Make sure has_relationfield_installed is always defined. This fixes a bug introduced by 'Dexterity support for the related items viewlet'.