compare ref type first to make sure $entry_ref is not weirdly overloaded

one snippet:

    use Math::BigInt;
    no strict 'refs';
    # $round_mode = bless( do{\(my $o = 'even')}, 'Math::BigInt' );
    my $round_mode = *{'Math::BigInt::round_mode'}{SCALAR};
    print 'ok' if $round_mode;

Because Math::BigInt overloads "bool" operation, the "if $round_mode"
dies with message "Not a HASH reference".  Bullet-proof against this by
ensuring that the type of the $entry_ref that we get back is the type of
the object we are looking for.

This was often less of a problem on perl < 5.18.0, when hash's keys()
behavior changed:

   Hash randomization
    The seed used by Perl's hash function is now random. This means that the
    order which keys/values will be returned from functions like "keys()",
    "values()", and "each()" will differ from run to run.

i.e. previously it was predictable if Math::BigInt::round_mode was
reached; on 5.18.0 and later it is not.