Refactor: Replace character array with std::string tempdir