Fix a bug in LSM chunk reference counting on shutdown.