improve thread safety when observing and working with log item list
- improve thread safety when observing and working with log item list.
- Add a new API to restrict the size of the log item list
related to tpo/applications/vpn#314 (closed)
A separate MR in tor-vpn is required to finish the fix for tpo/applications/vpn#314 (closed)
also fixes #102 (closed) by restricting the max size of the cached log items