add mean!, which allows pre-allocated output
add documentation for mean!
Merge pull request #6207 from lindahua/dh/mean3

add mean!, which allows pre-allocated output