[Issue #1477] Adding lock around setting of finished state.