Fixing GraphicsContext state checks to support oilpan

Debug assertions in the GraphicsContext destructor were
dependent on object destruction order, which made them
incompatible with oilpan. The state validation logic
was refactored to make the state validation checks more
useful.

BUG=370793

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

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