Improved handling of poll/socket errors, disconnections, etc. Client
won't crash any more if the server goes down. The entire set-up is quite
messy though, no neat solution due to multi-thread model?