This caused segfaults when calling win_findbuf in an `on_detach` callback, when the callback was triggered when closing the last window containing the buffer.
TextYankPost