Flush data before plugin is destroyed.