libdgram: Fix an error path memleak