PDI-9534 and PDI-9867: Backported fixes...

...for Hive/Hive2/Impala metadata and ESAPI/PMR issues