patch 8.2.0858: not easy to require Lua modules

Problem:    Not easy to require Lua modules.
Solution:   Improve use of Lua path. (Prabir Shrestha, closes #6098)
diff --git a/src/optionstr.c b/src/optionstr.c
index ff0186f..c03d994 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -2402,6 +2402,11 @@
 	    setmouse();		    // in case 'mouse' changed
     }
 
+#if defined(FEAT_LUA) || defined(PROTO)
+    if (varp == &p_rtp)
+	update_package_paths_in_lua();
+#endif
+
     if (curwin->w_curswant != MAXCOL
 		   && (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0)
 	curwin->w_set_curswant = TRUE;