rpc: make generatetoaddress locals const
rpc: make generatetoaddress locals const

Summary:
and named the same as in generatetodescriptor just above.

This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19133 | core#19133]] [2/10]
https://github.com/bitcoin/bitcoin/pull/19133/commits/9be7fd35c5d631c2cc34d3b4fa63ae0a9d5a68ef

Backport note: we use `get_int64` instead of `get_int` for `max_tries` because of D7138

Depends on D9941

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9942

Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc