[TSan] Add a regression test for https://code.google.com/p/thread-sanitizer/issues/detail?id=47