Recent scan bugs

This PR fixes a bug for whom Olivier (@delallea) recently provided a short script to reproduce. It also encompasses a better implementation of a PR proposed by Guillaume. 

The fix does two things: 
(1) ensures that safe_new returns a Theano variable (not a graph)
(2) make_node does casting and moving to CPU/GPU of inputs in order for them to match their corresponding version in the inner graph of scan