Close popover when the user hits escape

Right now, if you have a popover in a modal, hitting escape closes the modal but not the popover. To fix this, and just make things more consistent, let's allow people to close popovers with the escape button as well.

@Dylnuge @yayalice