fix nesting when we lookup in stashes by reference

it worked fine for RT as we look into RT::, but not deeper

we don't use anything deeper, but it would be good to keep
code in sync with Symbol-Global-Name extension which was
updated and released to CPAN.
Merge branch '4.0/sync-with-symbol-global-name' into 4.0-trunk