In all cases where either party shall sue out a certiorari upon any judgment where the same shall be allowed by law, the successful party in the superior court shall recover costs in both courts.