Fix endian issue in core.demangle

Variable `num` of type `size_t` is viewed as an array of chars.
This does not work on a big endian architecture.