[SPARK-2730][SQL] When retrieving a value from a Map, GetItem evaluates key twice

JIRA: https://issues.apache.org/jira/browse/SPARK-2730

Author: Yin Huai <huai@cse.ohio-state.edu>

Closes #1637 from yhuai/SPARK-2730 and squashes the following commits:

1a9f24e [Yin Huai] Remove unnecessary key evaluation.

(cherry picked from commit e3643485de8fdaf5c52b266fead1b13214f29d5e)
Signed-off-by: Michael Armbrust <michael@databricks.com>