[WIP] Scan crash fix

Do not merge, it is not ready for merge, but I want feedback, especially on the commit  https://github.com/nouiz/Theano/commit/bd67fd8a1aaada905f2e45434ae2ce0b49ce2579

All the commit above this one are stuff to help debug it!

@pascanur, can you review the change to scan? Also, should we do a similar fix to the line above? @lamblin suggested to replace the line above by:

    outer_inp_seqs += [x[::-1][:scan_node.inputs[0]] for x in self.outer_mitsot_outs(outs)]

NEWS.txt:

- crash fix/shape fix
- FINISH this list

TODO:
add tests!