travis: make sure example runs and terminates correctly

Uses a headless X server and mesa's software rasterizer. Supports 2.1 with
many extensions. When travis updates their ubuntu version, I think we'll get
3.2.