Modules: fixed promise events handling.

Previously, promise chain might not be invoked at all in some cases.
Specifically, this happened in HTTP module if promise chain did not start
with a r.subrequest() invocation.

The fix is to always process all pending promise events after the main module
function.

This closes #359 issue on GitHub.
diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c
index 976f3b7..56b2bdd 100644
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -79,11 +79,7 @@
         return NGX_ERROR;
     }
 
-    if (njs_vm_pending(vm)) {
-        return NGX_AGAIN;
-    }
-
-    return NGX_OK;
+    return njs_vm_run(vm);
 }
 
 
diff --git a/src/njs_vm.c b/src/njs_vm.c
index 5658727..2aa8461 100644
--- a/src/njs_vm.c
+++ b/src/njs_vm.c
@@ -578,7 +578,7 @@
 
     } while (!njs_queue_is_empty(promise_events));
 
-    return njs_posted_events(vm) ? NJS_AGAIN : NJS_OK;
+    return njs_vm_pending(vm) ? NJS_AGAIN : NJS_OK;
 }