renew contracts early if their funds are exhausted
This PR updates the contractor so that it will renew contracts prematurely (before their end height) if they are about to run out of funds. Previously, the contracts would be useless until the next renew period.