WebGL: Free temporary GPU resources held by inactive or hidden WebGL.

This CL applies Canvas 2D change in r165966 to WebGL

TEST=fast/canvas/webgl/webgl-composite-modes-tabswitching.html,
DrawingBufferTest.verifySetIsHiddenProperlyAffectsMailboxes

BUG=391400

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

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