Socialist Castillo confirmed as president of Peru