Revert "libdpkg: Use varbuf_detach instead of ad-hoc code"
This reverts commit 77cae397a15baeca11c26aeb806b6be516e33d5f.
This change introdcued two points for memory leaks, which could be
significant, depending on the amount of calls to the functions.