Merge changes If7fa11e7,I345c9a5d

* changes:
  liblog: have writers handle their own state
  liblog: use a rwlock for writer initialization