Do not fail when last element in attribute path has a dot

We were not substituting the MAGIC_DOT string for the last element.
Merge pull request #1989 from vuntz/json-edit

Do not fail when last element in attribute path has a dot