Use the server ready flag file for discard test also

This test was occasionally failing. I see that there is a file open mechanism to make sure that the client does not attempt a connection before the server is ready. With this change the test is a little bit more robust.