Don't try to access the ResourceProvider when it may be NULL.

When binding a software output surface, we set a new managed memory
policy. This calls through the LayerTreeHostImpl to ask the
ResourceProvider to dump its textures. The bind call happens at a point
during LayerTreeHostImpl::InitializeRenderer where the ResourceProvider
is destroyed, causing a crash.

Add a test for this mechanism.

BUG=304384

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227909 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 227909