Fixed the broken build on OSX caused by cgroups::enabled().

Review: https://reviews.apache.org/r/21664