Task
Build a small `bg_job_runner(tasks)` that ties 4 module-3 ideas together:
Each `task` is a dict with `{"id": str, "work": int, "fail": bool}`. The runner must:
1. **Iterate deterministically** β process in list order so tests pass.
2. **Retry up to 2 times** on tasks with `fail=True`. On the 3rd attempt the task succeeds (simulating a flaky dep that eventually responds).
3. **Track each task's final state** β `{"id": id, "attempts": n, "result": work*10}`.
4. **Return** the list of results in the original order.
(We avoid real `async` here so the recap stays Pyodide-friendly; the retry semantics are the actual idea you carry into module 4.)