Understanding the thermal stability of silver nanoparticles embedded in a-Si