[WIP] Fix tests

This PR try to make all tests pass for those combination:

for linker in vm cvm; do
  for gc in True False; do
    for lazy in True False; do
      echo "Executing tests with linker=${linker},vm.lazy=${lazy},allow_gc=${lazy}"
      echo "THEANO_FLAGS=linker=${linker},vm.lazy=${lazy},allow_gc=${lazy} theano-nose ${ARGS}"
      THEANO_FLAGS=linker=${linker},vm.lazy=${lazy},allow_gc=${lazy} theano-nose ${ARGS}
    done
  done
done

This is needed to help tests PR gh-1308. When this PR is finished, we should rebase gh-1308 on top of master, then redo those tests. This will make sure we didn't introduced problem that was tested.