fix issue with concurrent db writes

This makes sure that
1. ThreadBuffer.render does not cause unboundedly recurr
  and tries to write to the index multiple times when the index is locked.
2. makes sure that these writes - caused by our overwritten .render method -
 do not cause a change in the ui-layout by triggering notifications.
 This would confuse urwid and kill the UI.

 fix #583
Merge branch '0.3.4-feature-autounread' into testing
prevent accidental remove-unread operations

This ensures that explicit tag-unread commands
are not reversed upon the next keypress due to the newly
triggered auto-remove unread.

Also, this replaces a global write lock with message-local
write locks for this feature, allowing to browse through
multiple messages and auto-reming the unread tag even if the index
is locked