Make pty.js compatible with node v0.11.x by using nan.

/cc @chjj  @TooTallNate