Make tests less flakey: improve time.sleep in startServer

Instead of waiting for a predefined time to allow the server to stand
up, let's sleep many time for shorter periods. Before exiting verify
if the server started.