prevent calling getstaticcode on something NQPMu-ish

On MoarVM we get away with checking for isnull, but this is not enough for
JVM. This unbusts SVG::Plot and Pod::To::HTML. The error is triggered when
we apply a trait to a sub or an Attribute and the module gets precompiled.