Add window closing for triangle example

This causes a task failure or two, but it's a start...
Merge pull request #26 from bjz/window-close

Add window closing for triangle example