Bind to task events instead of process ones.

In pulsar API listen to task events and depend on task.status to know its closing resolution, because now we have duplication of taskProcess.onData and onClose in pulsar.createTask and pulsar.getAvailableTasks.