Crashlytics #679, #685.

Add a lock around setOperation so that we don't end up calling it
more than once in parallel.  The crashes above are caused when
we call removeObserver and addObserver in this call in a race.