retrying on socket errors instead of dying

Helps when uploading apps, which are uploaded fine and begin running, but cause the tools to die.