Repository: bokeh/bokeh

Issue:
[BUG] stdin transmitted in subprocess
In bokeh.util.dependencies.py detect_phantomjs():
```
proc = Popen([phantomjs_path, "--version"], stdout=PIPE, stderr=PIPE)
```
I suppose missed `stdin=PIPE`
If i'm use `export_png` in **python console** and paste several rows at once code after will be fall into phantomJS stdin.
And that will throw an error in phantomJS which will throw an exception here
```
if len(out[1]) > 0:
  raise RuntimeError('Error encountered in PhantomJS detection: %r' % out[1].decode('utf8'))
```
Example of error:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/export.py", line 97, in export_png
    image = get_screenshot_as_png(obj, height=height, width=width, driver=webdriver, timeout=timeout)
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/export.py", line 217, in get_screenshot_as_png
    web_driver = driver if driver is not None else webdriver_control.get()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/webdriver.py", line 116, in get
    self.current = self.create()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/webdriver.py", line 121, in create
    return create_phantomjs_webdriver()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/webdriver.py", line 75, in create_phantomjs_webdriver
    phantomjs_path = detect_phantomjs()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/util/dependencies.py", line 117, in detect_phantomjs
    raise RuntimeError('Error encountered in PhantomJS detection: %r' % out[1].decode('utf8'))
RuntimeError: Error encountered in PhantomJS detection: "events.js:183\n      throw er; // Unhandled 'error' event\n      ^\n\nError: read ECONNRESET\n    at _errnoException (util.js:1022:11)\n    at Pipe.onread (net.js:628:25)\n"

```
**I'm create PR for this**
[BUG] stdin transmitted in subprocess
In bokeh.util.dependencies.py detect_phantomjs():
```
proc = Popen([phantomjs_path, "--version"], stdout=PIPE, stderr=PIPE)
```
I suppose missed `stdin=PIPE`
If i'm use `export_png` in **python console** and paste several rows at once code after will be fall into phantomJS stdin.
And that will throw an error in phantomJS which will throw an exception here
```
if len(out[1]) > 0:
  raise RuntimeError('Error encountered in PhantomJS detection: %r' % out[1].decode('utf8'))
```
Example of error:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/export.py", line 97, in export_png
    image = get_screenshot_as_png(obj, height=height, width=width, driver=webdriver, timeout=timeout)
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/export.py", line 217, in get_screenshot_as_png
    web_driver = driver if driver is not None else webdriver_control.get()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/webdriver.py", line 116, in get
    self.current = self.create()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/webdriver.py", line 121, in create
    return create_phantomjs_webdriver()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/io/webdriver.py", line 75, in create_phantomjs_webdriver
    phantomjs_path = detect_phantomjs()
  File "/home/savalek/.local/lib/python3.6/site-packages/bokeh/util/dependencies.py", line 117, in detect_phantomjs
    raise RuntimeError('Error encountered in PhantomJS detection: %r' % out[1].decode('utf8'))
RuntimeError: Error encountered in PhantomJS detection: "events.js:183\n      throw er; // Unhandled 'error' event\n      ^\n\nError: read ECONNRESET\n    at _errnoException (util.js:1022:11)\n    at Pipe.onread (net.js:628:25)\n"

```
**I'm create PR for this**


Discussion:

Resolving patch:
diff --git a/bokeh/util/dependencies.py b/bokeh/util/dependencies.py
--- a/bokeh/util/dependencies.py
+++ b/bokeh/util/dependencies.py
@@ -107,7 +107,7 @@ def detect_phantomjs(version: str = '2.1') -> str:
         phantomjs_path = shutil.which("phantomjs") or "phantomjs"
 
     try:
-        proc = Popen([phantomjs_path, "--version"], stdout=PIPE, stderr=PIPE)
+        proc = Popen([phantomjs_path, "--version"], stdout=PIPE, stderr=PIPE, stdin=PIPE)
         proc.wait()
         out = proc.communicate()
 


Test patch: