Add ESC support to all modals

Hello,

After opening the print/pdf modal using Cmd+P, element focus is not inside the modal.

I was unable to close the modal using the keyboard (Esc did not work).

Thank you!

Ah, user preferences modal (Cmd+,) has the same problem!