Fix DetectDuplicate's handling of an 'append'-type flag.

Testing Done:
Ran the broken tests, verified that they succeed with this change.

Reviewed at https://rbcommons.com/s/twitter/r/1282/
Sync of https://github.com/pantsbuild/pants/commit/5bb31037e7af129e4bf26d9bb093527006e8c6e6