Fix error handling in uart_connect
Fix error handling in uart_connect

Define the semantics of uart_connect to close the UART fd if
returning an error. This avoids that we close the uninitialized
UART fd in case the open call already fails.

Signed-off-by: Stefan Agner <8bf81831f67286fff829779134e88c94b37210a1@toradex.com>

bwalle/imx_usb_loader,boundarydevices/imx_usb_loader