make sqlite connection thread safe