delphi: Add explicit cast for overflow cases

Also don't call Move with a length of 0.

This avoids ERangeCheck runtime errors.
delphi: Avoid signature mismatch for GetIdentity procedure

Don't define TArray0To2OfUInt8 twice.