use reftype not ref to check code refs

An upcoming Test::Builder will break these tests without the fix.