ssh-krb-wrapper: Fix up INTEGER encoding

Ignoring negative numbers wasn't helping. It encoded 255 wrong. Just
copy the nasty loop from the JS version. Also simplify encoding of
lengths.