Called by the default on-set-focus and on-kill-focus.
Enables or disables the caret in the view's buffer, if there is one, and maintains the internal focus flag used by is-focus-on?.