Fix error in Java name mangling

The name mangler was creating invalid names, which were truncated,
leading to collisions for test038.

Additionally, more potential collisions are fixed by padding digit codes
to a common length, so that identifiers containing numbers don't clash
with different-length character codes.
Merge pull request #813 from david-christiansen/java-name-mangling

Fix error in Java name mangling