Add histogram for buffer-flush-reason, and tweak xpcshell helpers