Fixed strict aliasing violation.

Changed C-style cast and dereference to std::memcpy.  Exactly mirrors other code already in the file.