Problem: heap use-after-free if OptionSet autocommands from setting a terminal's &buftype wipe the buffer. Solution: set b_locked during OptionSet for &buftype.