Merge pull request #11 from jimpurbrick/master

Avoid constructing a FilePermission object in checkRead if base manager ...
Add initial support for a new context.isClientRunning() API,
which allows nails to test for client disconnection and is
demonstrated by a new Heartbeat.java example.

The new API is implemented by sending a heartbeat chunk from the
client every 100ms which the server looks for to determine whether the
client is still alive. In order to read client heartbeats even when
there is pending stdin data to be read, NGInputStream stores pending
stdin data in a byte buffer and sends startinput chunks to the client
when it is ready to receive new data. This primitive flow control may
slightly degrade throughput, but as nailgun clients and servers are
expected to run on the same host the impact should be negligible.

The heartbeat support can be tested by running ./ng
com.martiansoftware.nailgun.examples.Heartbeat which should print one
hash per second until the client is killed at which point the exit
code of 42 should be shown in the server log. Running cat /dev/zero |
./ng com.martiansoftware.nailgun.examples.Heartbeat tests that the API
works when the client is sending data that is not read by the
nail. Running ./ng com.martiansoftware.nailgun.examples.Echo tests
that the API works when the nail is reading but the client is not
sending data and cat /dev/zero | ./ng
com.martiansoftware.nailgun.examples.Echo tests that the API works
when the client is sending data that the nail is reading.

Needs testing and probably fixing on Windows.
Add support for NGClientListeners and win32 support.