am d012d06b: Fix the ordering of lock acquisition in the heap worker.

Merge commit 'd012d06b0673c3da9d23b1816ff5a325576eb9b3'

* commit 'd012d06b0673c3da9d23b1816ff5a325576eb9b3':
  Fix the ordering of lock acquisition in the heap worker.