Fixed ExternalContainerizer fd leak and premature close.

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