attach finalisers to IORef instead of plain heap objects