Add check_output method for python 2.6 or lower versions.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>