Self reference detection defensively handles null bean names

Issue: SPR-12018