Fix #1418 (problem with JSON unflatten when using common prefixes)

This is a tentative fix for issue #1418 (Problem with JSON unflatten when using common prefixes):

https://github.com/lift/framework/issues/1418

Some sample code to reproduce the problem is included in the issue.