shutdown fixes for the shared pool

also some minor findbugs warnings in Socks code and some test reworking