Bugfix for DROOLS-354 and DROOLS-540 on Windows

Backport of the bugfix from master branch to Drools 6.1.x branch