Support OpenBSD, FreeBSD, and NetBSD

Tested on OpenBSD, but the others should behave similarly.
Support terminals without the CHA opcode

Some terminals, for example OpenBSD without X, do not support the Cursor
Character Absolute (CHA) opcode. Detect support and use CR/CUF instead
on those terminals.