core: reset cur_opt shortcut after use, it points to local variable
- safety to prevent invalid access on future extensions
(cherry picked from commit 1faf19fa7d34528b6cc15ffcb1ec91a6c6074e90)
(cherry picked from commit eb3f7cbc27fd678891910a14377ef0c5a3477bb0)