Generate correct code for effectful ForeignImports.
Merge pull request #194 from pjonsson/effectful-ffi

Generate correct code for effectful ForeignImports.