JSON API: strip trailing dots when creating zones

Otherwise we end up with example.org. in the DB, when it should have been
example.org .