Share logic across our two transforms (#78680)
This reduces a small bit of duplication between our two transforms (`toPath` and `fromPath`) and fixes a small bug in `postcss` where we didn't register the environment variables it read as dependencies which could cause persistence issues.
Finally, batch `log` messages sent by webpack transforms, the turbopack side doesn't read them until the end anyway and we can reduce overhead a touch by sending them in a single batch.