Fixed issue on multi-threaded sqlite access