In patch [1] get_cmdline_from_pid function was modified to be able
to parse process' cmdline files with arguments separated by space
instead of '\0' char.
This patch adds one extra UT and small refactor which was pointed
in comments to [1] but which I was not able to change there.
[1] https://review.openstack.org/#/c/647605/
Change-Id: Ibd91d0472a686eca79a1126154d9cdf4587c1a19
Related-Bug: #1820870
(cherry picked from commit dcc3d3c754)
(cherry picked from commit 4bab42e94c)