cmSystemTools: Use const_cast more locally

It is only needed for the second argument to strtoul.  Avoid casting
earlier to keep the safety checks elsewhere.
Merge topic 'VERSION_no_sscanf' into next

9a8b7669 cmSystemTools: Use const_cast more locally