Gamepad: make gamepad events play well with page visibility

This CL attempts to guarantee that we inform the page about every device
change and do it without sending events while the page is hidden.
For the first claim to be true we need to compare the current state with
the state the had the page had seen the last time when it was visible.
Note that the browser side might suspend the gamepad thread so simply
queuing the events is not enough.

R=bajones@chromium.org,abarth@chromium.org
BUG=386846

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

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