[BZ-1138420] fix very inefficient algorithm to read a byte array from an InputStream

(cherry picked from commit ef77b58dc743140ee4240892e7c161cb3d72d759)

Conflicts:
	drools-core/src/main/java/org/drools/core/util/IoUtils.java
[BZ-1138420] fix very inefficient algorithm to read a byte array from an InputStream
Bugfix for DROOLS-354 and DROOLS-540 on Windows

Backport of the bugfix from master branch to Drools 6.1.x branch
Bugfix for DROOLS-354 and DROOLS-540 on Windows

Backport of the bugfix from master branch to Drools 6.1.x branch
[DROOLS-596] remove tuples from the right memory when gc'ing them
(cherry picked from commit 6071eb701bb3f913e55a6121f442480c4e51fde5)
[DROOLS-594] fix path mask initialization when a segment as an accumulate as last node
(cherry picked from commit e1c0efabeea4b768fc683466ad65ce48c4be6246)
Merge pull request #380 from chearius/6.1.x

Bugfix for DROOLS-354 and DROOLS-540 on 6.1.x branch (backport from master)
Merge pull request #2 from droolsjbpm/6.1.x

sync 6.1.x