In South Africa and Kenya, some green energy projects have deprived local communities of land and livelihoods instead of sharing the benefits.