Chancellor Philip Hammond has become the second Cabinet minister to announce they will quit the Government if Boris Johnson becomes prime minister.