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 .
Merge pull request #1316 from zeha/api-auth-strip-trailing-dots

JSON API: strip trailing dots when creating zones