Ensure s.State is not closed if it was not previously opened.
Merge branch '122-fix-panic-already-closed' of github.com:davecheney/juju into 122-fix-panic-already-closed