Fix appendLengthEncodedInteger for large numbers > 0xffffff

If the value is ≥ (2^24) and < (2^64) it is stored as fe + 8-byte integer.

The current function seems to be ignoring this case xD.