javascript cleanup
Disable editing zone data/metadata when api-readonly is set

Also fixes a race.