scons: In Check(Cxx|Link)Flag, only install the flag if it exists.
scons: In Check(Cxx|Link)Flag, only install the flag if it exists.

These functions where correctly returning whether a flag had existed,
and also correctly not installing it if asked not to. Unfortunately if
they *were* asked to install the flag, they ignored whether or not it
had actually existed to begin with.

Change-Id: I2dca0e1a0ddbc182576d48237aeea5452a02c51b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41159
Maintainer: Gabe Black <d3e8afea784ab4a50a2dbf9149d2eaa8478e1cbc@gmail.com>
Maintainer: Jason Lowe-Power <92de577f37050ad05b60626d2f17913f40dcb1a2@gmail.com>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Reviewed-by: Jason Lowe-Power <92de577f37050ad05b60626d2f17913f40dcb1a2@gmail.com>

gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5