Fix stack overflow in rpm2extents
Creation of array struct digestoffset offsets[rpmfiFC(fi)] caused a
stack overflow because the total size is greater than 8M which is the
stack size limit on Linux. To fix the issue, the array is allocated on
the heap.
I used AddressSanitizer to find the root cause of the issue. It found a
number of memory leaks so I fixed them as well.