Remove duplicate variables when pruning
Created by: kexinzhao
When I was debugging test_rnn_encoder_decoder, I found out that there are duplicate variables with the same name in the pruned program desc.
The reason is in the following code: https://github.com/PaddlePaddle/Paddle/blob/b15c675530db541440ddb5b7e774d522ecaf1533/paddle/framework/prune.cc#L107-L131
A variable which is input and output of multiple operators will be added multiple times.
Will fix this along with #8161 (closed)