[DL]: Add nested lock tests + fix-up code to make some of them pass.

This patch adds nested lock tests and fixes up some code paths to ensure
we don't DCHECK or otherwise crash. Note that two of the tests are marked
as failing due to the open (referenced) bug.

R=chrishtr@chromium.org

Bug: 882663, 926276
Change-Id: Ie0786d53edac9824d74190ab48450a15ea50e24d
Reviewed-on: https://chromium-review.googlesource.com/c/1446568
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627611}
11 files changed