XHR - Trigger readystatechange when transitioning from HEADERS_RECEIVED to DONE

Fixes #3877