Add workaround for https://github.com/saltstack/salt-api/issues/61

This is a workaround for https://github.com/saltstack/salt-api/issues/61 which seems to be resolved simply by casting the instances to the type passed into the function declaration rather than creating a new type via POINTER().