Add retry logic for Publishtests

@Praburaj 

adding retry logic as discussed
I think it is only WebException on Mono. So the comment may not be accurate.