Avoid unnecessary dirty state when mutating properties to an equal value.

Mutators check whether the new value equals the current value and change
the state accordingly. The typecast in Property#set occurs after this check
which results in unnecessary dirty flagging when the new value equals the
current one after casting.

Typecasting now happens in property mutators (and Resource#attribute_set)
at the earliest point possible.
Ensure attributes= typecasts values for Property keys.
Deprecate typecasting of default property values.