[mach-o] use reference with "auto" to prevent copies

Patch by Jean-Daniel Dupas