Merge pull request #20029 from davidflanagan/bug1020002

Bug 1020002: don't allow an activity choice that could subvert forward-lock(cherry picked from commit 5415cffccb81a637e4a9c225dce819b89e104933)

fix failing test
Merge pull request #20091 from davidflanagan/bug1020002-v1.4

Bug1020002 v1.4