validation: split out pringDiag from testNamespaceInheritType
validation: split out pringDiag from testNamespaceInheritType

To be able to deal with diagnostics in a general way, split out the diagnostics
handling code into a new function `pringDiag()`, which will be normally called
from the defer function's context. This way we can simplify the error handling
routines.

Signed-off-by: Dongsu Park <696fb7639d678a1e692fa501217d7509545d7331@kinvolk.io>

opencontainers/ocitools,opencontainers/runtime-tools,opencontainers/runtime-tools,liangchenye/ocitools,liangchenye/ocitools,opencontainers/ocitools