etcdserver: fix data race in retrieving self stats

@unihorn thoughts?
supersedes #1315, #1313
um... i think holding a lock while doing encoding is not a good practice...