fix shared array reference in lcs-merge for case list issue
add a test case for lcsMerge

it is not linked into any automated framework
but will be a helpful regression test for anyone who touches this
Merge pull request #3990 from dimagi/case-list-duplicates

fix shared array reference in lcs-merge for case list issue