path: don't use std::string::pop_back (gcc 4.6 compatibility)