Correct exception handler sprintf for 32-bit (#3608)
The size of ULONG_PTR varies based on the address size of the
architecture. For 32-bit systems, it was invalid to treat it like a
64-bit value. By casting the value to a void pointer and changing the
print code to %p, we get the right thing for all platforms
(cherry picked from commit 0e892065bd1287f55568e62dd962a7cb57d30e52)