Fixed a bug with Debugger

Sometimes the Debugger crashed the game, after recording an FPS of
infinity. Also made the Textbox check for an existing canvas before
creating a new canvas. Also fixed a bug where key released weren’t
being recorded properly, along with one where unknown keys weren’t
being handled properly.