Add window closing for triangle example

This causes a task failure or two, but it's a start...