Explicitly set ports for all Uri#replace methods

@danschultz PTAL

To avoid :0 ports in the replaced URLs