to avoid lot of unnecessary casts afterwards Issue #798
This patch reflects eventual allocation errors in a more specific way to the caller of 'alloc_aligned', in particular out-of-metadata and out-of-memory are considered as different conditions. Related to issue #526.