[turbopack] Implement remainder of local Vcs: casting and get_task_id (#68474)
*This is a migrated PR. This was in the turbo repository before the
next.js merge.*
**Migrated From:** https://github.com/vercel/turbo/pull/8871
## Description
With these changes, local Vcs (introduced in #68469) should have a fully
functional implementation.
These remaining methods were pretty straightforward.
After this, my focus will shift back towards the changes needed to tasks
to allow us to make use of local Vcs.
## New `resolve_type_inner` helper method
I merged the implementations of `resolve_trait` and `resolve_value`,
since their implementations were 95% identical. I think this is an
overall win, though the logic to prevent duplicate `ValueType` lookups
(they're not expensive, but this code is also potentially very hot) is a
bit messy.
## Testing Instructions
```
cargo nextest r -p turbo-tasks -p turbo-tasks-memory
```