Fixed bug #64821 Custom Exceptions crash when internal properties overridden

If user inherits Exception and overrides the properties to arbitrary data types,
or simply doesn't run parent::__construct(), here we go. Just convert everything
to the appropriate data type, like Exception::__toString() does.
fix heap overflow warnings on win x64 debug crt
php_stream_fopen_tmpfile may file, causing any following stream usage to crash
more check for php_stream_fopen_tmpfile failure
Fix unitialized vars when sql.safe_mode=1

which can break the subsequent mysqlnd_connect() call
other fix for #64214, unmodified file may not have old fp set, causing other possible crashes
entry for #64214