Wrap window and renderer with deleter.

This ensures that we destroy them in the proper order (e.g. res gets
destroyed first).