Compile calls of Casper limit functions conditionally
This fixes compiler warnings that the variables used as arguments to
the Casper limit functions are unused when Casper support is disabled.
Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)