Cover border cases in s_write and s_remove related with IO errors