Fix multiple UString::c_str() calls in the same function call
Fix multiple UString::c_str() calls in the same function call

If you called UString::c_str() twice it would invalidate the first
call's return value, breaking stuff where it was called multiple times
(e.g. Data::Data() calls LogInfo("%s %s", c_str(), function(c_str())
which would cause invalid memory access)

Instead track is a string has been modified since it's last c_str()
call, and only reset the internal std::string copy (where the c_str()
return is copied from) if it's been changed.

This will still break if you do something like:
function(str.c_str(), str.modify(), str.c_str())

but better than it was

AndO3131/OpenApoc,Istrebitel/OpenApoc,FranciscoDA/OpenApoc,FranciscoDA/OpenApoc,steveschnepp/OpenApoc,pmprog/OpenApoc,pmprog/OpenApoc,steveschnepp/OpenApoc,AndO3131/OpenApoc,FranciscoDA/OpenApoc,ShadowDancer/OpenApoc,Istrebitel/OpenApoc,ShadowDancer/OpenApoc,AndO3131/OpenApoc