Refs #8509 Fixing OSX complier error

OSX didn't like a std::ofstream being given a const std::string, so i've added .c_str() to all calls to getTestFileName() within an ofstream constructor