fix various build warning (cause test failure on x86_64)

At least the call to convert_to_int64/convert_to_int32 cause memory corruption and various test failed.

I still have a tests/600_extension_clear.phpt failing (only during "make test", not on manual work... I'm working on it)