Avoid writing undefined properties in JSON localStorage
Merge branch 'master' of github.com:systemed/iD. Fixes #924