imx_usb: fix getopt_long hang on ARM and segmentation fault

On ARM platform, char seems not to compare with -1. Avoid this
implementation variation by using an integer to store the return
value of getopt_long.

Also fix a segmentation fault when there is no job at all.
imx_uart: retry up to 10 times during association phase

This allows to start the utility before entering recovery mode
and also avoids problems in case one character was still in the
buffer and similar problems.