use cgroups to track agent lifetime.

This addresses issue #2.