The Welsh Government has taken a major step towards making Wales the first nation in the UK to ban greyhound racing after winning a key vote.