Fix duplicate host contracts
There was a bug where hosts could have two active contracts for the same period.
Changed order of how old contract was removed in renew code.
Added additional check for contract link in
managedCheckForDuplicates to remove old contracts that might still be active due to an interruption during renewal.