Specs for closed windows

Tidies up windows_switching_spec and adds several tests for when windows are closed.