Fix dictRehash assert casting type.

Also related to #1929.