core: Upgrade flatmap to JSON when dynamic attributes are present
core: Upgrade flatmap to JSON when dynamic attributes are present

When a resource type schema includes dynamically-typed attributes we can't
do any automatic conversion from flatmap to JSON because we don't know
how to interpret the keys that start with the dynamically-typed
attribute's prefix.

To work around that, we'll instead just ask the SDK to do a no-op upgrade
(current and target versions are the same) which will convert from flatmap
to JSON using the SDK's own logic as a side-effect.

This situation should rarely arise in real-world use, but it ends up being
very important for the helper/resource provider test harness because it
is forced to lower the state back to flatmap repeatedly after every step
in order to run legacy checking and processing code.

brandontosch/terraform,ewbankkit/terraform,pryorda/terraform,tommynsong/terraform,rnaveiras/terraform,brandontosch/terraform,apparentlymart/terraform,nlamirault/terraform,apparentlymart/terraform,apparentlymart/terraform,VladRassokhin/terraform,pdecat/terraform,pdecat/terraform,luis-silva/terraform,heimweh/terraform,heimweh/terraform,drebes/terraform,hashicorp/terraform,ewbankkit/terraform,VladRassokhin/terraform,pryorda/terraform,hashicorp/terraform,ewbankkit/terraform,VladRassokhin/terraform,brandontosch/terraform,tommynsong/terraform,rnaveiras/terraform,heimweh/terraform,hashicorp/terraform,pdecat/terraform,tommynsong/terraform,gechr/terraform,apparentlymart/terraform,drebes/terraform,heimweh/terraform,nlamirault/terraform,brandontosch/terraform,drebes/terraform,drebes/terraform,rnaveiras/terraform,pradeepbhadani/terraform,pradeepbhadani/terraform,pradeepbhadani/terraform,luis-silva/terraform,brandontosch/terraform,VladRassokhin/terraform,nlamirault/terraform,pryorda/terraform,luis-silva/terraform,apparentlymart/terraform,heimweh/terraform,gechr/terraform,pdecat/terraform,ewbankkit/terraform,gechr/terraform,luis-silva/terraform