Only run dsymutil on OSX in debug builds

When there are no debug symbols generated, then the program just prints an
annoying warning otherwise.

Closes #10198