Universality of the matrix Airy and Bessel functions at spectral edges of unitary ensembles