Clean tmp folde when quit command result in socket.error.

Remove unused imports and make it pep8 friendly.

Signed-off-by: Luke Inman-Semerau <luke.semerau@gmail.com>