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>