PLAT-539: fixed build error on Bamboo by ensuring that we only free the heap version of the demangled exception name