Add acc_dtype member to CAReduceDtype

This dtype is to be used as accumulator, instead of self.dtype as was
previously the case. Then, the result is cast to self.dtype if needed.

Also implement the perform version using it.
Update C code to use acc_dtype if needed.

If acc_dtype == output.dtype, nothing changes.
Fixes to gradient.

Do not create a complex tensor with zeros, then cast it into floatX,
create the floatX zeros directly
Fix assertion
Add acc_dtype to the interface of prod/sum/mean
Add tests for new features and behaviour
Make the copy explicit
Reorder keyword args
Update doc
Merge pull request #1226 from lamblin/stable_reduce

More stable reduce operations by default