Fix EZP-20845: Wrong working directory when using legacy kernel at the end of the request