Fix PMA_arrayWalkRecursive to ensure single pass thru keys

Fix a bug with PMA_arrayWalkRecursive that causes it to apply a function
to its keys/values more than once. A previously incorrect test is fixed
as well.

The bug happens because when keys are modified, PHP's foreach loops
through the new keys again. This does not usually happen unless the
iterating array is passed through by reference (or has refcount=1).
See: http://stackoverflow.com/a/14854568/791890

Please see #936 for full explanation.

Signed-off-by: Jeff Chan <jefftchan@gmail.com>