Lift some code from llvm-dlltool, the lld code is meant to follow what
gnu ld does but that's not much useful for our purposes.
Also use the `--kill-at` option when generating the .lib files out of
mingw's .def files: this way our building process closely matches the
one use by the upstream and now finally generates files that allow both
C code and Zig code to link.