ruby: fix crash on Compound#_cpp_delete