patch 9.0.2015: Vim9: does not handle islocked() from a method correctly

Problem:  Vim9: does not handle islocked() from a method correctly
Solution: Handle islocked() builtin from a method.

- Setup `lval_root` from `f_islocked()`.
- Add function `fill_exec_lval_root()` to get info about executing method.
- `sync_root` added in get_lval to handle method member access.
- Conservative approach to reference counting.

closes: #13309

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
diff --git a/src/structs.h b/src/structs.h
index c7cf412..5131858 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -4604,13 +4604,16 @@
 } lval_T;
 
 /**
- * This may be used to specify the base type that get_lval() uses when
+ * This may be used to specify the base typval that get_lval() uses when
  * following a chain, for example a[idx1][idx2].
+ * The lr_sync_root flags signals get_lval that the first time through
+ * the indexing loop, skip handling  '.' and '[idx]'.
  */
 typedef struct lval_root_S {
     typval_T	*lr_tv;
     class_T	*lr_cl_exec;	// executing class for access checking
     int		lr_is_arg;
+    int		lr_sync_root;
 } lval_root_T;
 
 // Structure used to save the current state.  Used when executing Normal mode