server: drop stale queued tasks for terminal workflows (#7015)