Set an LDAP error code when failing ldap_bind due to null bytes

Some applications check a LDAP link's error code after seeing ldap_bind
fail due to a null byte bind attempt and hence incorrectly receive the
last set error code.

Fix by setting an LDAP error code before returning in this case.
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Set an LDAP error code when failing ldap_bind due to null bytes
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Set an LDAP error code when failing ldap_bind due to null bytes
Fixed bug #51800 proc_open on Windows hangs forever

This loop can block for some minutes, theoretically. Practially
however, this is a 99% non issue for a normal use case. This is
required because read() is synchronous. The PHP streams API wants
to fill its internal buffers, therefore it might try to read some
more data than user has demanded. Also, for a case where we want
to read X bytes, but neither enough data nor EOF arrives, read()
will block until it could fill the buffer. If a counterpart station
runs slowly or delivers not all the data at once, read() would
still be waiting. If we quit too early, we possibly could loose
some data from the pipe. Thus it has to emulate the read()
behaviour, but obviously not completely, just to some grade.

Reading big data amount is for sure an issue on any platforms, it
depends on the pipe buffer size, which is controlled by the system.
On Windows, the buffer size seems to be way too small, which causes
buffer congestion and a dead lock. It is essential to read the pipe
descriptors simultaneously and possibly in the same order as the
opposite writes them.

Thus, this will work with smaller buffer data sizes passed through
pipes. As MSDN states, anonymous pipes don't support asynchronous
operations. Neither anonymous pipes do support select() as they are
not SOCKETs but file descriptors. Consequently - bigger data sizes
will need a better solution based on threads. However it is much
more expencive. Maybe a better solution could be exporting a part
of the internal doing as a userspace function which could perform
some kind of lookahead operation on the pipe descriptor.

This is just the first stone, depending on the user feedback we
might go for further improvements in this area.
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Fixed bug #51800 proc_open on Windows hangs forever
updated NEWS
increase the polling period to not to break existing behaviours
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  increase the polling period to not to break existing behaviours
better test cleanup

and even force the XFAIL to fail as it would take too long anyway, even if it passes
fix tests on linux
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  fix tests on linux
  better test cleanup
one more test to illustrate transfer of an arbitrary data amount throug pipes
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  one more test to illustrate transfer of an arbitrary data amount throug pipes
fix test filename
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  fix test filename
use $PHP_LIBDIR instread of "lib" in skel example
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  use $PHP_LIBDIR instread of "lib" in skel example
remove bogus locale use from test
only no_NO.ISO-8859-1 have to be ignored
update NEWS about the release date of 5.6.1