Fixed bug with leading 0s in privkey hex format

Support#int_to_hex now takes an optional second argument specifying
the required number of characters in the output string.
Where known to matter, the uses of int_to_hex have been modified
to specify the required chars.