Fixing issue #4769 (stale element can get into executeScript)

Fixing issue #4769 by use result of recursive walk of arrays/objects.
Adding test for this problem.

the CLA has been signed.