This patch solves bug T60194.
It reverts changes made by commit bb98e83b99e63348e0396a5ffe5bb2a20ff1607a by @Bastien Montagne (mont29), but it does not seem to cause a regression on bug T55668. Even with the patch applied I was unable to reproduce this bug.