Die when the X11 connection breaks during runtime (Thanks Eduan)
implemented logging the number of failed attempts

This closes #1243