Merge "Part of fix for TEE resource leaks when app crashes" into jb-mr2-dev