Added usage data queue flushing in several places

Refs #851 and #840