[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