FIX: Shutdown sockets before closing them