attempt to prevent KeyError from happening in buildsphinx
Merge pull request #1058 from eteq/fix-keyerror-at-exit

Prevent KeyError when build_sphinx fails in ``-w`` mode