TEST: Fix invalid ast transformer in test.

The ast transformer used in test_interactiveshell.TestAstTransformError
had an incorrect method signature, causing it to raise a TypeError when
called, rather than the expected ValueError.  This change makes the test
transformer actually throw the expected error.
DEV: AST transformers supplied to `InteractiveShell` can reject input.

* Adds a new exception class, `InputRejected` to IPython.lib.security.
* Updates `InteractiveShell.run_cell` and
  `InteractiveShell.transform_ast` to allow user-supplied AST
  transformers to reject input by raising an `InputRejected`.
* Adds tests for the above behavior.
MAINT: Move `InputRejected` to `IPython.core.error`.
BUG: Explicitly close Tee in AssertPrints and AssertNotPrints

Fixes a test failure caused by the Tee object being lazily closed only
when an AssertPrints/AssertNotPrints object is garbage collected.
Merge pull request #6429 from quantopian/transformer-rejection

Make it possible for AST transformers to reject input.