Handle `#[cfg(...)]` attributes on turbo tasks (#8542)
### Description
If a task is conditionally compiled, we must conditionally register it.
Noticed this when trying to write a test with `#[cfg(test)]`.
**Related:** #8530 adds support for registering tasks inside of `mod foo { ... }` blocks.
### Testing Instructions
Tested as part of #8529