tests/netinet: push variable 'sin' into function scope
This should fix build with GCC 13.
Fixes: 861274c9f8cf2a5c00ded9580ea91b22def683f7