format: writer: Propagte failure to caller

* Return a boolean to the caller on a failure instead of just returning.
  This allows the caller to cancel the write to the file so that it
  isn't corrupted.