Fix msvc link error

Replaces https://github.com/astropy/astropy/pull/2478

@mdboom: can you confirm that this is ok, and merge if so?