Nonradiative vibrational relaxation of diatomic molecules isolated in solid rare-gas matrices