singleipconnect: remove dead assignment never used

cppcheck pointed this out.
cleanups: reduce variable scope

cppcheck pointed these out.