Retry writting socket on certain conditions (Fixes elcuervo/airplay#39)

HEADS UP: It will probably need some other fixes in the future since I couldn't
reproduce the original bug
Version bump