Use sync(1) instead of sleep(1)

 - the invocations of sleep(1) seem to be to wait until changes are
   actually written from cache to disk. But depending on the underlying
system they might even never be committed or take longer than the
specified sleep(1) amount. If you want to wait until the cache contents are
committed, use sync(1) instead.