fix sqlite thread lock