etcdserver: add publish func

for #1094 
i want to make successful case return at the end of the function, based on https://code.google.com/p/go-wiki/wiki/CodeReviewComments#Indent_Error_Flow, which indicates that it should handle error case in indent first, then good one.