Revert "Fix crash on Windows when --enable-stats is set"

This reverts commit 0b1ad9dbcab6beba52a2ae4e677fb8f5a8ed8878.