Gets rid of the local write spool buffer.

ProxyOutputStream historically had ByteArrayOutputStream into which data gets spooled until it gets connected, when it is used underneath Pipe that writes from local and read remotely. This was to emulate the built-in buffer of Pipe until it gets connected, but this buffer is unbounded, and it has been observed in the wild that this buffer has grown to 128MB and causes OOME:

    2014-12-09_13:02:30.49536 Exception in thread "RemoteInputStream greedy pump thread: hudson.remoting.RemoteInputStream$Greedy
    2014-12-09_13:02:30.49539       at hudson.remoting.RemoteInputStream.<init>(RemoteInputStream.java:100)
    2014-12-09_13:02:30.49540       at hudson.remoting.RemoteInputStream.<init>(RemoteInputStream.java:83)
    2014-12-09_13:02:30.49540       at hudson.FilePath.untar(FilePath.java:510)
    2014-12-09_13:02:30.49541       at hudson.plugins.cloneworkspace.CloneWorkspacePublisher$WorkspaceSnapshotTar.restoreTo(CloneWorkspacePublisher.java:243)
    2014-12-09_13:02:30.49541       at hudson.plugins.cloneworkspace.CloneWorkspaceSCM$Snapshot.restoreTo(CloneWorkspaceSCM.java:396)
    2014-12-09_13:02:30.49542       at hudson.plugins.cloneworkspace.CloneWorkspaceSCM.checkout(CloneWorkspaceSCM.java:152)
    2014-12-09_13:02:30.49543       at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
    2014-12-09_13:02:30.49543       at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:692)
    2014-12-09_13:02:30.49544       at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    2014-12-09_13:02:30.49544       at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:601)
    2014-12-09_13:02:30.49545       at hudson.model.Run.execute(Run.java:1684)
    2014-12-09_13:02:30.49545       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    2014-12-09_13:02:30.49547       at hudson.model.ResourceController.execute(ResourceController.java:88)
    2014-12-09_13:02:30.49548       at hudson.model.Executor.run(Executor.java:232)
    2014-12-09_13:02:30.49548 " java.lang.OutOfMemoryError: Java heap space
    ...
    2014-12-09_13:02:34.48968 INFO: Tom - 2. Integration tests #162 aborted
    2014-12-09_13:02:34.48968 java.lang.InterruptedException
    2014-12-09_13:02:34.48969       at java.lang.Object.wait(Native Method)
    2014-12-09_13:02:34.48969       at hudson.remoting.Request.call(Request.java:146)
    2014-12-09_13:02:34.48970       at hudson.remoting.Channel.call(Channel.java:751)
    2014-12-09_13:02:34.48970       at hudson.FilePath.act(FilePath.java:967)
    2014-12-09_13:02:34.48971       at hudson.FilePath.act(FilePath.java:951)
    2014-12-09_13:02:34.48971       at hudson.FilePath.untar(FilePath.java:511)
    2014-12-09_13:02:34.48972       at hudson.plugins.cloneworkspace.CloneWorkspacePublisher$WorkspaceSnapshotTar.restoreTo(CloneWorkspacePublisher.java:243)
    2014-12-09_13:02:34.48972       at hudson.plugins.cloneworkspace.CloneWorkspaceSCM$Snapshot.restoreTo(CloneWorkspaceSCM.java:396)
    2014-12-09_13:02:34.48973       at hudson.plugins.cloneworkspace.CloneWorkspaceSCM.checkout(CloneWorkspaceSCM.java:152)
    2014-12-09_13:02:34.48973       at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
    2014-12-09_13:02:34.48974       at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:692)
    2014-12-09_13:02:34.48974       at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    2014-12-09_13:02:34.48975       at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:601)
    2014-12-09_13:02:34.48977       at hudson.model.Run.execute(Run.java:1684)
    2014-12-09_13:02:34.48977       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    2014-12-09_13:02:34.48978       at hudson.model.ResourceController.execute(ResourceController.java:88)
    2014-12-09_13:02:34.48978       at hudson.model.Executor.run(Executor.java:232)

I suspect that the channel went unresponsive first, then someone created a local to remote Pipe and started filling the local end. In such a case, the pipe will never get connected, and so the write fills up the local temporary buffer.

In this change, I'm getting rid of the local temporary buffer altogether. I suppose this can increase the latency of this specific pipe operation, but the other fix is to have a bounded buffer size, and the added complexity doesn't seem to be worth it.

See: https://rm.cloudbees.com/issues/2782
Avoid race condition.

NioChannelHub.newChannelBuilder()'s anonymous NioChannelBuilder.makeTransport() waits for startedLock then assumes selectorThread is non-null. So the selectorThread variable needs to be set before the notifyAll() happens.