clean up state when wait() is interrupted. re-fixes #3373
Merge branch 'master' of github.com:JuliaLang/julia