Set the port settings before open in the examples

Change-Id: I946a3f1d3a64a9b8c0d901347aa8ff5959ebc601
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Use QScopedPointer (RAII) for avoiding the memory leak for udev

Task-number: QTBUG-37578

Change-Id: I9e9146a1f7339a88c63cb320a47f63f069a6120e
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>