Catch all kinds of errors.

Copy-pasted from the dwm source code. I'm fed up of all the crashing, so
here I'm catching all the errors that dwm is catching too.