Sync the write ahead log in a separate thread.