I also think that the GUC is not needed here. This 'feature' was internal from the very beginning, so users shouldn't care about preserving old behavior. Without the GUC the patch is very simple, please see attached version. I also omit the test, because I am not sure it will be stable given that the RemovePgTempFiles() allows the possibility of failure.
Anastasia, thanks for reviewing it. As I said, I'm fine without the GUC. However, if we decided to go with the GUC, default behavior should be remove the temporary files after the crash.