Make map_reduce @spec stricter

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
Merge pull request #2890 from styx/more_strict_spec_for_map_reduce

Make map_reduce @spec stricter