Voidify write() calls. Fixes #3174.