Improve subprocess management

Improve the management of the api processes started by behave:
* Fail fast if there is another api process running on the same port
* Cleanup hanging processes in case of exceptions