Use consistent error handling when IO fails

Change-Id: Idfca664637d5e3db41770fe0137b11b2cab36952
Reviewed-on: http://review.couchbase.org/42427
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>