Replying to nbruin:
If I'm correctly understanding the problem, trac_13447-consolidated_refcount.patch should be the preferred solution.
I didn't test the patch yet. However, it seems very straight forward to me: There already is a refcounting, and thus one should use it. I am Cc'ing Volker Braun and Martin von Gagern, the authors of #11339. Does trac_13447-consolidated_refcount.patch make sense to you as well?
Keeping a double refcount (as with trac_13447-double_refcount.patch seems suspicious to me.
Perhaps one should let the patchbots test it? Thus, I'll add this as dependency for #715, and for the patchbot:
Apply trac_13447-consolidated_refcount.patch
PS: You really deserve a badge for debugging excellence! Do I understand correctly that the bug is not on the side of Singular? I'll inform Hans accordingly.