subsys/profiling: fix extra frame in the traces

Check if the frame is within the text address before saving
into the buffer, this eliminates the extra, uninitialized frame
at the end of the unwind.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
3 files changed