Gloucestershire overcame a brave effort from the Unicorns to chalk up their third YB40 victory of the season at Bristol.