Make {AdvancedSubtensor,CSM}.infer_shape work for node not in an fgraph.

This cause crash of scan_opt.PushOutNonSeqScan opt.
Cache Scan.connection_pattern(). Hopefully, it will speed up theano.grad.
Don't pre-merge constant that aren't hashable.
Make MakeSlice.make_node accept the node inputs as parameter.

This is needed for scan optimization to rebuild the node outside the scan.
Fix _metadict to allow removing un hashable value.

_metadict is a dict that work with not hashable type. This is needed
for the SliceType.
allow debugprint() to work on list/tuple of any of the objects is support.
get_scalar_constant_value() now work over maximum and minimum
get_scalar_constant_value() now know about Rebroadcast(x,...).shape[idx].
[BUG] Scan now correctly raise error when it get negative steps or 0 steps.

fix gh-1455 by making all version raise an error. (But not always the same error).

This also fix the problem where test_rop where randomly returning some
bad answer, but making that case return an error (0 step in scan). We still need to find why the scan save mem sometimes generated scan with 0 step.