When creating a new script thread a new VM object is transparently created by base_newthread(). This new VM does not copy the source VM foreignptr.
I fixed the issue in my build by adding the copy: newv->_foreignptr = v->_foreignptr; to base_newthread() but I don't like moving out of the core distribution.

I use the foreignptr to store a reference to a per-VM manager of native C++ references. If the object is destroyed on the C side the manager takes care of invalidating the script references that might exist.