I haven't verified this by testing, but the lrucache code looks a bit broken.
Possible fix is in my lrucache branch - see e3f671c. I based it on my PR #339 / commit 57845c0 "Clean up fds of segments we delete (during compaction)", so I guess it's blocked on that PR. It'll teach me to keep better PR discipline :).
https://github.com/sourcejedi/attic/tree/lrucache