Check for failures in memory allocations

Make sure to report the failure (usually exiting) in case of memory
allocation failures.
Free memory buffers when not used

While supermin is a short-lived application, some of the allocated
buffers depend on sizes from the filesystem being read, which could lead
to keep too much memory allocated and potentially not allowing supermin
to run properly.