Fix issues with timeout

- select accepts microseconds, not nanoseconds
- fix some valgrind issues
- correct typo in RX485_ADAPTER definition