Use an underline cursor in replace mode.

The original patch was by Quentin, with subsequent tweaks by me to
follow style, move logic from the autocommand into a function, use an
underline cursor in virtual replace mode, and to fallback to the normal
insert cursor should some other mode appear in the future.

Patch-by: Quentin Bazin <quent42340@gmail.com>