software/theia: Select free ports automatically

Changes:
- Add comments and reorganise instance.cfg.in for clarity
- Select free ports instead of hardcoded ports
- Upgrade to slapos.core 1.6.5 to prefix forwarded requests

This makes it possible to recursively nest theias into theias.

See merge request !919
2 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
passed SlapOS.SlapRunner.ResilienceTest-Master

00:27:10

failed SlapOS.SlapRunner.ResilienceTest-Master.ERP5

00:16:31