After all, it turned out that the issue dealt with in this thread has its good share of subtleties. Now I think it's better to rewrite this patch as a patch series. So, please just ignore this thread from now on; I'll start a new one when the new patch series will be ready.
Thanks, Stefano