2-9-517. Contribution between sureties. Whenever the sureties on either bond have been compelled to pay any sum of money on account of the principal obligor therein, they are entitled to recover in any court of competent jurisdiction of the sureties on the remaining bond a distributive part of the sum thus paid in the proportion which the penalties of such bonds bear one to the other and to the sums thus paid, respectively.