Make sure game is not null in keyboard events

This comparison was already added in
6ae0ddb2d4761808dedd158efe5daa99cb22082e but for some reason it got
overwritten.