api: proper type casting for MSVS support.

Closes https://github.com/veox/sgminer/issues/113