[ticket/12543] Only take over ENTER and ESC keys when alert box is active.

PHPBB3-12543
Merge pull request #2458 from prototech/ticket/12543

[ticket/12543] Only take over ENTER and ESC keys when alert box is active.

* prototech/ticket/12543:
  [ticket/12543] Only take over ENTER and ESC keys when alert box is active.