[9.18] Do not use header_prev in expire_lru_headers
dns__cacherbt_expireheader can unlink / free header_prev underneath it. Use ISC_LIST_TAIL after calling dns__cacherbt_expireheader instead to get the next pointer to be processed.
(cherry picked from commit 7ce2e860)
Closes #4595 (closed)
Backport of !8773 (merged)
Edited by Ondřej Surý