[SP-341] log4j: ERROR Attempting to append to closed appender PENTAHOFILE when using PRPT that contains a KTR as datasource 

Backport to 4.4:

1) Detect if Kettle is running embedded or not. We are embedded if we are running in context of BA Server
2) If we are embedded then don't close log4j appenders as this causes log4j errors as there could be log4j logging from other log producers.