libcommon: add is_container function