Allow using msort_r CHERI-enabled architectures
If we are sorting something that is a multiple of sizeof(void*), we have to ensure that we swap one pointer at a time since swapping using sub-pointer-size stores invalidate the pointers (pointers have a hidden validity tags that is invalidated when performing non-monotonic operations such as storing only part of the pointers).
While touching this code also use G_ALIGNOF() instead of a macro that is generated at configure time.
Helps: #2842