Influence of phonon and electron excitations on the free energy of defect clusters in solids: A first-principles study