improve python server.py, add delay to tcp close