Add missing import socket in lib/s3.py