use IOLoop.current in a few places

better allow notebook server to run in a thread
run test server in thread

instead of subprocess
Merge pull request #7149 from minrk/thread-nb

run test notebook server in thread