Correctly truncate the localStorage chat log (Fixes Issue #130)