Sir Keir Starmer has apologised to his health secretary after allies of the prime minister accused him of plotting a coup.