Revert "Revert "Don't assume device IDs won't collide.""

This reverts commit 4e3ffc0d727fa3ab532ec43a6d047f6e5834689f.
(Android) Fixes a whole lot of issues - should force AKEYCODE_BACK
on touchscreen to always exit RetroArch - etc.