[Android] Properly validate potentially null InputDevice

As InputDevice.getDevice() makes no guarantees that the returned device
will be non-null, always validate the return value before using in a
meaningful way as a Gamepad device.

BUG=421168

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

Cr-Commit-Position: refs/heads/master@{#299016}