[turbopack] Fix a buggy serializer (#79520)
Because regexes aren't naively serializable, we use a simple alternate representation and then just re-parse them when deserializing. A trivial bug was introduced in #78251 that has broken deserialization. Fix that and add a unit test.
My only defense for such a silly mistake is that this was my first PR 🤦♂️