[WIP] Fix bug in remove_constants_and_unused_inputs_scan

This should fix a bug in Pylearn2 when using scan to perform linesearch.