Implement KeepAlive thread in high level client class and some better guarding in binary_server

As requested I did not use asio and re-invented the wheel ...
the interesting thing here is that this patch make example_client crash... however I think it only makes visible another problem in the client library that appeard ealier. Without this patch example_client does not crash but it does not complete either....