Only call the completion handler once when a context has no changes

Fixes #818