fixup! task: add support to set custom properties

Since property expansion will modify a definition's fields, Lists and
Maps need to be copied during a copy to prevent modifications on one
Task from modifying other Tasks returned from the same tasks-factory.
Also only copy a TaskBase's known field types to avoid potentially
copying a type which is not currently known, and thus may not be copied
properly. Also, add test case to validate the fix.

Change-Id: I551bf8a0532a7fb31ad21f8facc705535e69f3c5
2 files changed