Re #8142. Add a failing test that exposes the bug.

And a passing one in InstrumentTest (for a non-parameterized
instrument) as that's missing.
Re #8142. Add pass-through to base instrument if appropriate.

This fixes the issue of always getting zero back for a parameterized
instrument.
Re #8142. Fix coverity issues.

The base component (m_base) has to be of type Instrument; therefore use
a static_cast in place of a dynamic one.
Merge remote-tracking branch 'origin/bugfix/8142_nummonitors_fix'