Any person contesting any election under this subchapter shall be required to give security for costs in such amount and manner as the court shall order. Such security, however, shall in no case be enforced unless judgment for costs be rendered against the contestant.