Compiler Hangs on Invalid Record Update with `Prelude.head: empty list`
## Summary
In certain constellations, an invalid record update makes the compiler hang with the following output:
```
repro.hs:3:5: error: [GHC-14392]
Invalid record update.
No constructor in scope has all of the following fields:ghc: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
Prelude.head: empty list
While handling Prelude.head: empty list
HasCallStack backtrace:
bracket, called at compiler/GHC/Driver/Make.hs:2959:3 in ghc-9.12.2-5327:GHC.Driver.Make
```
It looks like it crashes when trying to print the offending field names.
## Steps to reproduce
Putting the following text into `main.hs` and running `ghc main.hs` produces the behavior for me:
```hs
import Data.Semigroup (getSum, getProduct)
a = undefined { getSum = undefined, getProduct = undefined }
```
The restricted imports seem to be important. Importing all of `Data.Semigroup` does not cause the behavior.
## Expected behavior
I expect the compiler to terminate with a proper error message rather crashing and hanging while printing the error message.
## Environment
* GHC version used: 9.12.2
Optional:
* Operating System: Arch Linux
* System Architecture: x86_64
issue