os/server: Fix indentation
os/server: Fix TCP connection

- remove unused errno
- remove unused port_end
- correct calculation of addr_len
- use correct string length during IP copy
os/server: Fix possible port overflow

- add documentation about port being optional
- parse port into long and check for valid value
Merge #874 'fix TCP connection (issue #870)'