Fix a few cppcheck findings
Merge pull request #1472 from LudwigOrtmann/cpp-check-a-bit

Fix a few cppcheck findings
native: uart reconnect buffer replay

When using socket stdio, add option to replay what has been written to
stdout while not connected (`-r`).

The implementation is to simply use the existing log file (which is
implicitly created when the option is used), and read from it until
EOF upon reconnect.

closes #476
native: cleanup

fix style
fix some syscall declarations
reorder syscall declarations
init syscalls in dedicated function
substitute 1 with EXIT_FAILURE