Here is a set of patches to address this issue.
The first one is a small refactoring of the signal setting portability
business.
The second one fixes the SIGQUIT handler inadvertently unblocking
SIGQUIT within itself.
The third one installs an alarm so that if the ereport() call in
quickdie() doesn't finish after 60 seconds, it skips it and finishes up.
The precise logic of this could be debated, but it more or less appears
to get the job done.