ci: introduce helper to preserve select env variables under sudo

Change-Id: Ia5db4b50e07a40c2eb256182a721c990c5b53382
Refs: #4610
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index c9e2a63..29a41ea 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -44,7 +44,7 @@
 
 ./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain
 ./waf build --color=yes -j${WAF_JOBS:-1}
-sudo env "PATH=$PATH" ./waf install --color=yes
+sudo_preserve_env PATH -- ./waf install --color=yes
 
 popd >/dev/null
 popd >/dev/null