Return the results of `write` instead of ok

dialyzer catching a failure