Optimize copying of allocator-free cpp_int's via memcpy.
Fix consistency of checks for exponents < 0 in powm.
Fixes #9231.
Refs #9236.