Adding application registry support

The API should be able to start application after the startup sequence
completed. All applications register themselves so the main thread can call
their join method.

When an application calls its join it is also remove from the registry.

This adds app_registry class to hold all the apps, when an application
is created with the run static method it is added to the registery. When
the app call its join method, it is been removed from the registry.

A join all static method was added so the main thread can call it and it
would call join for all threads.

To avoid the _KERNEL compiler directive, a helper function can be used to
create an application and register it.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Add run_app API

This adds an API to execute an app via the API.

Command is passed with its command line parameters, for example the
equivalent of: scripts/run.py -e "java.so -cp /java-example Hello" is:
curl -X PUT
http://localhost:8000/app?command=java.so%20-cp%20%2Fjava-example%20Hello

Multiple commands can be passed in a single command separate by an
ampersand, for clarity reason, semicolon separator is not allowed.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'stable/v0.14'