adds writing profile data to file
Merge branch 'master' of https://github.com/mlasak/app-profiling
postpones the closing of profile logging so last events of testcase are regarded