Critically ill newborns in Wales are set to benefit from a rapid genetic test that could cut the risk of lifelong hearing loss.