cpu: Remove incorrect branch predictor drain checks

The branch predictor unit incorrectly checked that the prediction
history was empty when the system is drained. This is an incorrect
assumption since the predictor isn't affected by a drain.
cpu: Limit the size of the decode cache

The decode cache can in some cases grow really large, which can even
prevent some systems from booting. This changeset adds a the ability
to limit the size of the decode cache and randomly prune a fraction of
the cache once it reaches its upper limit. The default behavior on
most architectures is now to allow 4k pages in the cache and prune 50%
once this limit is reached.
sim: Make the drain handler return unexpected exit events

The simulator can currently lose exit events while draining, which
confuses both simulation scripts and the simulated system. This
changeset modifies m5.drain() to return a tuple (drain_ok,
exit_event). The exit_event is valid if drain_ok is False and the
simulation script is expected to call drain() again if it still needs
the system to be drained.

In order to keep old configuration scripts from breaking, a separate
function, m5.legacyDrain(), is introduced with the same semantics as
the old drain function. Unlike the old function, this one emits a
warning if an unexpected simulation event occurs. Both m5.checkpoint()
and m5.switchCpus() have been updated to use this function instead of
drain(). Configuration scripts that need reliable draining should call
drain() manually and then request a checkpoint/CPU switch with the
keyword argument do_drain=False.
mem: Add an method to get current cache occupancy from Python
mem: Add a stat that exposes the current cache occupancy

There is already a stat that exposes the average cache occupancy. This
is however not enough for some applications. It is sometimes,
especially when warming a cache, desirable to know the current
occupancy of the cache rather than the average. This changeset adds
such a stat.