libceph: fix socket write error handling