More reliably remove cmd-logs.
The logic now keeps whatever cmd-logs are within the given timeframe. Everything else is deleted on disk. This effectively means all old cmd-logs which may hang around on disk without a corresponding jid in the db is now also deleted.