[asan] fix a self deadlock when printing stats; add a relevant test, cleanup that test while at it to remove linux/darwin differences. Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=306

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208525 91177308-0d34-0410-b5e6-96231b3b80d8