Destroying temporarily created HWND after test

To demonstrate prevention of resource leaking, this code utilizes the try-finally idiom to destroy tempoarily created HWND even in case of any exceptions or failed assertions.