Switch to using memcpy to avoid strict aliasing rule errors in GCC 4.4