added fclose() calls when method tracing is stopped via am profile <pid> stop