logctl: simplify and document a confusing function
Minor behaviour change: all affected lines are now moved to the end,
in the order they were specified in the kv struct (used to stay in
place) and duplicate keys are pruned (used to be left alone).
Example: kv pairs {"A", "1"} and {"B", "2"}, file:
C=3
B=8
A=4
B=6
D=4
Previously, the resulting file:
C=3
B=2
A=1
B=2
D=4
Now:
C=3
D=4
A=1
B=2
This has no effect on configs because the order among different keys
doesn't matter and a given key used to get the same value across copies,
but allows to simplify some logic.
Change-Id: Ib2ac9e07dced12614cde000dc3876e2887410537
Signed-off-by: Michal Bloch <m.bloch@samsung.com>