[XRay] Fix enter function tracing for record unwriting
Before this change, we could run into a situation where we may try to
undo tail exit records after writing metadata records before a function
enter event. This change rectifies that by resetting the tail exit
counter after writing the metadata records.
Differential Revision: https://reviews.llvm.org/D54292