Destroy modal panel in blur handlers

Fixes #275.