Move the alignment query function to common.cpp

Use the existing size query function when validating the pointer
alignments.
Use the device to report pointer alignment errors

Instead of writing to cerr directly
Use constant char pointers instead of strings

This avoids constructing string objects (which make heap allocations) at
runtime.