Import r2179 of the libelftc demangler.

Also apply two additional fixes:

- Initialise trn to NULL before returning it (submitted by Tim Northover)
- Move the check for _GLOBAL_I_ to before the check for short encodings.

The first fixes possible crashes, where an invalid pointer is passed to free().
Fix (anonymous namespace) demangling.
Avoid a redundant malloc() / memcpy.