Fix XHR resource leaks.

ResourceLoader unregister self from its resource on releaseResource, but it is
needed to call deleteIfPossible to delete a Resource object. Moreover, it is
dangerous to have a Resource once clearLoader is called in ResourceLoader, because
it can be deleted anytime.
This CL releases the resource in releaseResources.
Because it is dangerous to touch ResourceLoader member variables when m_state is
Terminated, this CL inserts many
 - ASSERT(m_state != Terminating) and 
 - if (m_state == Terminating) return;
statements.

BUG=402743

Review URL: https://codereview.chromium.org/477553002

git-svn-id: svn://svn.chromium.org/blink/trunk@180749 bbb929c8-8fbe-4397-9dbb-9b2b20218538