Fix breakage of DSO loading on all platforms

bc00a9937 fixed a spelling error, but failed to fix the accidentally
inverted logic, meaning that instead of underscores being
unconditionally omitted, they would instead be added when they are
not needed, and omitted when they are needed.

Exit statuses are hard. Used EXIT_SUCCESS/EXIT_FAILURE in the hopes of
making the code readable.