Minor cleanup of lockless_ring (which, mind you, is probably subtly broken in numerous ways). Performance of directly writing to SQLite is unacceptable. Looking for alternatives.