Fix routepolicy checkUrlPrefix

Found because I happened to be looking at the linker output and
thinking, "um, why is `type` being declared as a package-scope
variable?"  :-)

Added checkUrlPrefix unit test.