fix($compile): merge attributes safely for IE8

Merging an <input> with an <input> in IE8 will automatically break
because the "type" attribute may not be set automatically on in-document
elements. This change makes Angular replace only unchanged
attributes. Additionally, source and target attributes are only merged
by concatenation if their values differ, to avoid unexpected results
such as 'type="text text"'.

Closes #4029