Add PingManager.pingServerIfNecessary()

which is basically the body of the pingServerRunnable available as
public part of the API. The intention is to allow 3rd party
components (e.g. Android's AlarmManager) to trigger the code.
Improve FileTransfer.writeToStream()

let's use the standard idiom for Input- to OutputStream transfers. This
also avoids an initial no-op on the first write, when the count is '0'.

Also fixes a bug when the size of file/stream transferred is '0' (which
is perfectly fine and possible).