Publish a dedicated event just before disposing the context

This is needed for example for GUIs which want to dispose of their
windows before the context goes away.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>