[codable] When generated encode for a property, distinguish in between static/instance properties.
Previously, we just took the first match so:
1. We would try to emit a metatype lookup of the property but had prepared an instance lookup.
2. Could get the wrong type if the static/instance property had different types.
rdar://39669212
(cherry picked from commit 3d990e98d214b1ef34652b120cb449cf9132fba3)