c: Don't expose internal types such as Socket, Thread, Mutex etc anymore

Split Device and IPConnection into public and private part and hide the
later one from the public API.
Fix outdated comments