Fix issue 13666: Undefined Symbols for __gshared data symbols in templates

https://issues.dlang.org/show_bug.cgi?id=13666

OMF: do not ignore COMDEF records when scanning library for symbols
MACH: write comdef symbols as type N_SECT, not N_UNDF

I'm actually just guessing for the mach object files, but it seems dubious to export a symbol in a comdef as "undefined". I've mostly copied stuff from the pubdef records.