Compiled code only needs to be on stack if internalized

We only need to mark this as on stack when internalizing, since only
internalize could cause a lock and needs the compiled code object to be
updated.