Support for gl-init-rs

Most of the code is adding an example. Please tell me if I need to add or change something.

Closes #153 
If I don't put this line here, `device.close()` will block forever.
Maybe this should be changed in `device.close()`?