Fix pkg.version on Windows.

Fixes #4492

Makes pkg.version conform to pkg standards better.