The number of pubs in Wales has grown so far this year, bucking the trend of closures in recent years.