Brazil's Petrobras posts $500 million loss despite record exports to China