Fix build problems with Oracle Solaris Studio

refs #6896
Fix invalid exit code

fixes #7058