Fix race condition in Writer spec