The president criticized bankers for giving themselves $18.4 billion in bonuses as the government was rescuing firms.