Fix printing errors and exit code for pdc_client
Fix printing errors and exit code for pdc_client

Use a logger to print errors and debug messages.

Set non-zero exit code on error.

Replaces `with` statement with try/except/finally and remove context
manager. Context managers are normally used to free resources after an
object is not needed, here it was abused to store exception and print
stack.

JIRA: PDC-2132

product-definition-center/pdc-client,product-definition-center/pdc-client