Sync and close calls after writes are done.