Use const CCoinsView's at some places.

At some places where it is possible (e. g., CheckInputs), use a const
version of CCoinsView instead of a non-const one.