libs: fix API export/import and 'inconsistent linkage' on MSVC