added a way to control flushing when the app becomes inactive

This change is needed if you run an OS X app that does things in the background.