Add circular buffer mode.

This commit adds the functionality to set up a circular buffer in memory
which stores the last N seconds of video.  When the application is sent a
signal or a key is pressed the last N seconds are saved.