Use the complain mechanism to report write failures.

This ensures that we don't spam the log for each submitted value. Instead, an
exponential backup is used to report permanent errors starting at one message
per second.
Merge pull request #765 from tokkee/sh/write-err

Use the complain mechanism to report write failures.