Remove output from encoder when output is destroyed.

This fixes an issue reported by valgrind where a destroyed output is
still referenced by the encoder.
Destroy swapchain before removing the window info

This fixes an issue reported by valgrind where cleaning up the
swapchain fails because the window info is destroyed before.
Merge pull request #86 from fryshorts/fixes

Minor fixes for problems reported by valgrind