Fix stream includes throwing errors during global state preservation

Related to issue #1308.

I wasn't sure exactly where to write tests for this. Any guidance would be appreciated!
1. Why is `ftp` in the list of exceptions?
1. The two exceptions `file` + `phar` can be inlined into the regular expression using a negative lookahead.

  ```php
  if (preg_match('/^(?!file|phar)([a-z][a-z0-9.+-]+):/i', $file)) {
  ```