Fix use-after-free in usage of libbacktrace.
Fix use-after-free in usage of libbacktrace.

We passed the c_str of a temporary std::string to libbacktrace,
which stored that in internal data structures. Later on, that dangling
pointer was accessed leading to subtle bugs which for odd reasons
did not became apparent until recently. Running the interpreter
through valgrind easily showed the problem though.

This fixes the 'failed to read executable information' error messages
emitted by heaptrack, and also ensures the profile data attributes
costs to the correct modules.

CCMAIL: 20b285d415dab877cfa215821b3a32076f1e558c@kde.org

muojp/heaptrack,muojp/heaptrack,muojp/heaptrack,muojp/heaptrack,muojp/heaptrack