use getattr to check for close method in IOLoop.close

instead of catching AttributeError directly