[RFC] vim-patch:7.4.320

Problem:    Possible crash when an BufLeave autocommand deletes the buffer.
Solution:   Check for the window pointer being valid.  Postpone freeing the window until autocommands are done. (Yasuhiro Matsumoto)

https://code.google.com/p/vim/source/detail?r=v7-4-320
`win_valid()` returns `false` when `win == NULL`, so this can just be `if (win_valid(win))`.