Put the correct RPC port (default for the selected chain or set explicitly with -rpcport) into the RPC help text "curl" example. Previously, the port there was always reported as 8332 (default mainnet port). With this change, it will be correct for testnet/regtest or with an explicit -rpcport, so that the example can be used as-is in these situations.
This is a simplified version of #15158, following the discussion with @laanwj.