Romanian Justice Minister Florin Iordache has resigned over a controversial government decree that would have protected many politicians from being prosecuted for corruption offences.