On quadratic differentials with closed trajectories and second order poles