Setting the correct readyState while in the onclose callback