Fix Coverity errors (incl. serious crashers), rework sock being global static for...