Fix getting duplicate serial ports with null characters


The function toStringAndTrimNullCharacter() deletes only trailing zeroes
from right to left direction up to the first non-zero character were meet.
This can return the wrong string in case there are the zero characters to
the left of the non-zero characters.

We should look for the first zero-character from left to right direction,
and discard all right part of a string, including the zero-character.

Task-number: QTBUG-47127
Change-Id: I4d101b49bbb153bddbe535a920d616b5fef130e9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
commit84de1b10d242551a51b6c4ce5eda657c4743bc63
parenta2758cf594dd08a21037873f64f72166a353aa29
authorDenis Shienkov <denis.shienkov@gmail.com>
committerDenis Shienkov <denis.shienkov@gmail.com>
commit timeThu, 9 Jul 2015 17:16:24 +0000