Fix port and baudrate, add some checks

- extend baudrate from int to long because 38400 baud could be bigger than INT_MAX
- change TCP port datatype from int to uint16_t because int doesn't match the range
- add range check in every TCP binary
- add more checks in lower layers to avoid segmentation faults, out of bounds access and integer overflow
- make parseable for splint
- suppress splint warnings about datatype cc_t
- fix type of return value for read()
- add checks before accessing tty