etcdserver: apply entries when it is not empty

Or it updates appliedi wrongly.
etcdserver: init state before run loop correctly
Merge pull request #1891 from yichengq/257

etcdserver: init state before run loop correctly