Fix escapeParams in transclusions to not escape other transclusions

Use a stack counter to work out if we are inside a another template
call.

Bug: 49854
Change-Id: Ic0b97520b1696c3cf292111c7052502d5ccad648
Merge "Fix escapeParams in transclusions to not escape other transclusions"