Only try to find duplicates in non-sequences.

This should fix a bug in Pylearn2 when using scan to perform linesearch.
Merge pull request #1566 from lamblin/fix_scan_linesearch

[WIP] Fix bug in remove_constants_and_unused_inputs_scan