Update NaCl's generator to support new wait APIs.

TEST=compile monacl_shell and monacl_test in the Chrome repo and run the unit tests.
BUG=https://code.google.com/p/chromium/issues/detail?id=401761
R=mseaborn@chromium.org, viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/776643004