Kristi Noem is to be replaced as homeland security secretary, following criticism of immigration operations that left two Americans dead.