Refactor external begin frame source into a base class
There are several external begin frame sources in the code base,
and they all have the same logic. mus will need another. So,
refactor this logic into a base class that they all can reuse.
The followup to this will be to make Android's CompositorImpl's
ExternalBeginFrameSource derive from cc::ExternalBeginFrameSource.