Weird mixups in native embedded client

These fixes is founded by using fbembed server on x64 OS.
Maybe some fixes should be discussed.
sure. On 64-bit arg (of tyype IntPtr).ToInt32 throws OverflowException as described here:
http://msdn.microsoft.com/en-US/library/system.intptr.toint32(v=vs.110).aspx
But in native these variables are int32 -> second cast.