Fixed rare crash on Keyboard.isKeyDown

Fixes #1090
Merge pull request #1091 from Unkn0wn0ne/patch-1

Prevented rare crash on Keyboard.isKeyDown