fix WMStats reader when document is deleted between calls

fixes #5184