Update putfile.py

Added IOError handler.