Ninth Circuit allows bankruptcy courts to recharacterize loans as equity, applying state law