Defending champion David Ferrer reached the semi-finals of the Valencia Open with a three-set win against fifth seed Jerzy Janowicz.