src: remove static variables from string_search
These variables can as well be stack-allocated. This avoids relying on global state that is not protected by mutexes.
Thanks to Stephen Belanger for reviewing this change in its original PR.
Refs: https://github.com/ayojs/ayo/pull/82
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines