Workaround doublefrees until we get refcounting in Sdb