Copy action_plugin: encode content when dict.

When content is processed and found to be valid JSON it is decoded into a dict. To write it out to a file we need to encode it back into a string.

Addresses GH-5914.
Merge pull request #6057 from risaacson/issues_5914

Copy action_plugin: encode content when dict.