Enable locking rsync func in order to avoid race conditiond