Make sure cookie synchronization is thread safe. (#114)