Make v8 backend thread safe (ref #41)