Fix setting ports listening variable in cf-monitord.
Recently introduced check for file permissions was using binary path
including cmdln flags.

Redmine: #6845
(cherry picked from commit ea564226804dd108699db6831bb096babdc82941)
Fix RlistParseShown to handle arrays correctly.
Currently it leaves closing bracket "}" within the value when dealing with arrays.

Redmine: #6845
(cherry picked from commit 6a9d29c5b2c0919545d1f6b2832ba2fad6cd0d7b)
Merge pull request #2052 from maciejmrowiec/3.6.x

Fix handling ports listening monitoring variable.
Merge remote-tracking branch 'upstream/3.6.x' into 3.6.x_surfsara