IMPALA-3757: Add missing lock in RuntimeProfile::ComputeTimeInProfile
IMPALA-3757: Add missing lock in RuntimeProfile::ComputeTimeInProfile

We've seen a number of issues that appear to be a race
around the RuntimeProfile handling on the coordinator. We
don't have a consistent repro and haven't been able to find
the root cause of the crashes/hangs, but we have seen a
number of stacks from crashes that include the following
frames:

...
RuntimeProfile::ComputeTimeInProfile
RuntimeProfile::UpdateAverage
Coordinator::UpdateAverageProfile
Coordinator::UpdateFragmentExecStatus
...

This patch fixes a case where we iterate over children_
without holding the lock. I can't prove that this causes the
hangs but we certainly should fix this regardless.

Testing: Passed several exhaustive test runs successfully.

Change-Id: Ibb40ebfa2e58ecaa8668d30ad92003fc75483517
Reviewed-on: http://gerrit.cloudera.org:8080/3397
Reviewed-by: Matthew Jacobs <df2fa7c39d141dc5dc5589fed74180e757ed6c9a@cloudera.com>
Tested-by: Internal Jenkins

cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala