Fix two race conditions: event handlers were being added _after_ the loader was supplied a URL, and the error event handlers should not be removing the error handlers.  If an event handler is removed and there's an outstanding event, that results in an unhandled exception