Better error handling when (re)spawn of the shell fails.