Handle failure to read JSON waiting for server start

If the test controller tries to read the file while the server it has started is in the middle of writing it, it gets invalid JSON and fails.

This just loops again until we have valid JSON to read.