logd: use RAII locks and thread annotations

Test: unit tests
Change-Id: I38623130a96f17a47ed79753e24b25efa9e38279
3 files changed