error: add MEM_ERROR() macro

Add a new MEM_ERROR() macro that prints out of space with
the function it occurred in, and then aborts mksquashfs,
restoring the original filesystem if appending.

This macro allows "Out of memory" handling to be regularised
accross Mksquashfs, rather than at present where every
out of memory error has a different and hand crafted
error message.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: Use MEM_ERROR() for out of space handling.

Replace all hand crafted BAD_ERROR() messages with MEM_ERROR()
which does the same thing.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: Use MEM_ERROR() for out of space handling.

Replace all hand crafted BAD_ERROR() messages with MEM_ERROR()
which does the same thing.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
pseudo: Use MEM_ERROR() for out of space handling.

Replace all hand crafted BAD_ERROR() messages with MEM_ERROR()
which does the same thing.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
read_file: Use MEM_ERROR() for out of space handling.

Replace hand crafted ERROR() message with MEM_ERROR().

Note: out of memory will now immediately abort mksquashfs,
rather than the function returning error.  This brings
it into line with other code in mksquashfs.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
sort: Use MEM_ERROR() for out of space handling.

Replace hand crafted ERROR() messages with MEM_ERROR().

Note: out of memory will now immediately abort mksquashfs,
rather than the function returning error.  This brings
it into line with other code in mksquashfs.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
xattr: Use MEM_ERROR() for out of space handling.

Replace hand crafted ERROR() messages with MEM_ERROR().

Note: out of memory will now immediately abort mksquashfs,
rather than the function returning error.  This brings
it into line with other code in mksquashfs.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>