chr() check for invalid code points (jvm port)

Fixes S29-conversions/ord_and_chr.t failures.