The US president said he did not want global markets to fail but ‘sometimes you have to take medicine’.