use static local instead of pointer/global to make windows and possibly valgrind happy (followup 9e6e62d9c)