BZ-1153075 - AdHoc subprocess does not terminate even with Terminate end events inside

(cherry picked from commit b9b5e275d3ba289d20b902ea02bce20226db7624)