All-optical NMR in semiconductors provided by resonant cooling of nuclear spins interacting with electrons in the resonant spin amplification regime