Updated sync.erl for distribution

Still works for local system, but if distributes, a and b directory
disappear and files are written in “test” on two different systems