Execution of the nit code on another thread, and redefinition of basic input and output methods

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Updated the example for pnacl, to make it work with the threading update

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Suppression of the '-Werror' flag to avoid failing compilations and threading usage for complation

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Deleted useless 'while' and inlined write method

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Edited 'exit' function for pnacl in order to avoid crashes.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Updated the example, to show how to handle an 'exit' message in JS.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Added the 'run' method who is in charge of the infinite loop

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Updated the example with 'run' method

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Merge: PNaCl : Added threading to pnacl.nit

Added threading to pnacl.nit in order to launch Nit on a new thread and still be capable of handling messages.

Pull-Request: #492
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>