Foreign investment is flooding into a $34 billion mining boom, but weak local oversight and armed gangs leave rural communities exposed.