generator: removed wrong glue code for structs
generator: IntPtr.Zero for optional IntPtr params

IntPtr.Zero should be passed for optional IntPtr params
instead of null
generator: fix optional parameters again
generator: fixed glue code for callbacks