[tsan] improve the test that checks for lock inversion with 3 locks