libopkg: fix double-free crash on recursive package removal