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

https://tracker.phpbb.com/browse/PHPBB3-12543