chore(lockfiles) avoid hand written reflection (#6143)
### Description
As part of DYF I wanted to see if I could get rid of the
`global_changes_key` part of the `Lockfile` trait by leveraging `Any`.
Using `Any` has two benefits:
- It doesn't depend on uniqueness of the magic string chosen to be part
of the buffer that forms the key. (We've [already almost had an
issue](https://github.com/vercel/turbo/pull/5934#discussion_r1323509458))
- It doesn't require any allocations in order to perform this comparison
This gets us back to how the Go code used to work where we would take a
pointer to a `Lockfile` interface and attempt to downcast it to the same
concrete type before comparing fields.
### Testing Instructions
Verifying that `--filter=[HEAD^1]` works as expected:
- `npx create-turbo@latest test pnpm`
- `cd test && pnpm rm turbo && git add . && git commit -m 'rm turbo'`
(Remove local version of turbo so we can use global dev version easily)
- `cd apps/web && pnpm add is-number && cd ../../ && git add . && git
commit -m 'add is-number'`
- `turbo_dev build --filter='[HEAD^1]' --experimental-rust-codepath`
should only run `build` for `web`
Closes TURBO-1443
---------
Co-authored-by: Chris Olszewski <Chris Olszewski>