Adding correct calling convention to PInvoke delegates.

Fixes #1 - PInvoke stack imbalance exceptions.