Test: index dump on test failure

This changes adds the ability for a test to create an index dump if a search request fails the test. This can be helpful to be able to analyse the index state after the test has failed
Yeah, that would be better. I was looking around for the way we get the directory name for the data directory/cluster name but didn't find it. Will look again and use that maybe?