Use threading.Event to signal abortion of fetching.

Also closing the file object before aborting fetching.