libpkg: Add a version script.

This stops libpkg.so exporting symbols from statically linked dependencies.

Closes #827