In all cases of joint or joint and several indebtedness, the creditor may settle or compromise with and release any one or more of such debtors; and the settlement or release shall not affect the right or remedy of the creditor against the other debtors for the amount remaining due and unpaid, and shall not operate to release any of the others of the said debtors; and all mortgages or securities for the said indebtedness shall remain in full force against the debtors not released, in favor of the creditor, and also in favor of such of the debtors as may be entitled to contribution, payment, or reimbursement from others of said debtors, and the right of payment, contribution or reimbursement, as among themselves, shall not be affected by this section; and if any debtor, so released, shall have paid more than his ratable share of the whole debt, the whole amount paid by him shall be credited, and if less than his ratable share, then the full amount of his ratable share shall be credited, and the other debtors shall be liable for the residue.