[WFCORE-269] CLI freezes and it's not possible to terminate it

[WFCORE-269] CLI freezes and it's not possible to terminate it

https://issues.jboss.org/browse/WFCORE-269