native: uart reconnect buffer replay (+a little cleanup)

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.
Actually, there is no error indication of `-1` with `fread`, gotta fix this.