FreeRDP/FreeRDP — pull request #1855 by hardening (2014-05-21 15:52:31+00:00)
Title: Non blocking writes

This big patch allows to have non-blocking writes. To achieve this, it slightly changes the way transport is handled. The misc transport layers are handled with OpenSSL BIOs. In the chain we insert a bufferedBIO that will bufferize write calls that couldn't be honored.

For an access with Tls security the BIO chain would look like this:
```
FreeRdp Code ===> SSL bio ===> buffered BIO ===> socket BIO
```

The buffered BIO will store bytes that couldn't be send because of blocking write calls.

This patch also rework TSG so that it looks like this in the case of SSL security with TSG:

```
(TSG in)
> SSL BIO => buffered BIO ==> socket BIO
/
FreeRdp => SSL BIO => TSG BIO
\
> SSL BIO => buffered BIO ==> socket BIO
(TSG out)
```

So from the FreeRDP point of view sending something is only BIO_writing in the frontBIO (last BIO on the left). And reading is done the same, just BIO_reading in the frontBIO.