fix stack_counts file write when collector run is slower than whole request exec