Make `PopulationRateMonitor` take subgroups into account correctly.

This fixes #282, using the same code we use for dealing with subgroups in `SpikeMonitor`. This could certainly be improved from a performance point of view, we are currently doing the whole subgroup-related check even if we are recording from a whole group. But I don't expect a simulation to spend any significant amount of computation in this code and either way, correctness is more important.

Ready to merge.