Specify delegate marshalling policy.

.NET has problems with this as well.

Don't know yet if I have to save the delegate. As far as I remember
using StaticEnd like that would create a delegate on the fly which could
go out of scope and because of GC and the resulting pointer would be
null.