Correct write() error

As pointed out here: https://news.ycombinator.com/item?id=7679307