Toyota has had its credit ratings cut for the first time in a decade, hitting its shares and raising borrowing costs.