sync.sh: add check for previous running process