Fixed a deadlock bug in Mutex.

Review: https://reviews.apache.org/r/23592