Cleaner ol.Map#setTarget handling

This PR cleans up ol.Map#setTarget so that it does not modify the value passed to it.

A map's `target` property can still be a `string`, an `Element`, `undefined`, or `null`. With this patch the `string` to `Element` conversion is done later, internally, to avoid modifying the value it is set to.