etcdserver: split ID generation into a callable function and use that in...

... the no-argument case for main

Fixes #1350