html-writer: Correct execution count in index summary

I.e., count first, then write to the File class.