Create run_kernel context manager
Simplify ExecutePreprocessor using new context manager

Closes gh-6447
Merge pull request #6448 from takluyver/kernel-context-mgr

Add context manager for a kernel, and use it in nbconvert execute preprocessor