3D viewer: listen to events for lost and restore context

WebGL context can be lost and suddenly disappear. This is usually due to
a lack of resources. See [1] for some more details. The 3D viewer should
listen to those events and tell the user what is going on. Ideally, it
can also restore the 3D viewer once there is a context available again.
This commit realizes the first part, which at least makes sure CATMAID
doesn't crash anymore when the context is lost.

This is related to issue #774.

[1] https://www.khronos.org/webgl/wiki/HandlingContextLost