patch 8.0.0704: problems with autocommands when opening help

Problem:    Problems with autocommands when opening help.
Solution:   Avoid using invalid "varp" value.  Allow using :wincmd if buffer
            is locked. (closes #1806, closes #1804)
diff --git a/src/option.c b/src/option.c
index ebc547e..cdb0d67 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7570,6 +7570,9 @@
 		did_filetype = TRUE;
 		apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
 					       curbuf->b_fname, TRUE, curbuf);
+		/* Just in case the old "curbuf" is now invalid. */
+		if (varp != &(curbuf->b_p_ft))
+		    varp = NULL;
 	    }
 	}
 #endif