Improve battery_thread().
Delete logs from cache to free up some space when needed.