Work to improve locking in vterm.