Handle undef refs in jl_copy_ast, fixes #9475