Fix auto-rewrite-input (continues #5893)

Reissue #5893 rebased + fixes.

**But** rewrite_input is completely undocumented:
  - %autocall is the only thing I know of that rewrite input, 
  - notebook receive a `raw_input` field which is `undefined`. 
  - And the `transformed_input` one has : 
   1. the color escape code
   2. a fancy leading `->` that you absolutely don't want to set as cell's text.

eg: 
```
%autocall
print 'a'
```
send to the notebook 
```
transformed_input: "[0;34m-> [0mprint('a')", 
raw_input: undefined
```

Me sad, and don't know what to do ... :-( @fperez ?