dispatcher: refactor constructing environment variables from strv
This also avoids warnings with -O2 -Wstrict-overflow (gcc-4.8.3):
make[4]: Entering directory `./NetworkManager/callouts'
CC libtest_dispatcher_envp_la-nm-dispatcher-utils.lo
nm-dispatcher-utils.c: In function 'construct_ip6_items':
nm-dispatcher-utils.c:283:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (i != 0)
^
nm-dispatcher-utils.c: In function 'construct_ip4_items':
nm-dispatcher-utils.c:144:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (i != 0)
^
nm-dispatcher-utils.c:168:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
if (i != 0)
^
https://bugzilla.gnome.org/show_bug.cgi?id=741168