Javascript ajax lock