[aot] Avoid passing partially shared instances to the JIT. Fixes #13191.