<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->
We have several Kinesis streams set up with event notifications that trigger lambdas.  When the LAMBDA_EXECUTOR is set to 'docker' and we send a large number or records to Kinesis, multiple Lambdas will execute, but currently they are failing to create with error:

```
Exception: Lambda process returned error status code: 1. Output:
time="2019-09-18T17:28:11Z" level=error msg="error getting events from daemon: net/http: request canceled" 
Error response from daemon: driver failed programming external connectivity on endpoint busy_sanderson (a78e45a41d0ce5b0d8bab6ff54344fc34fe2b4969f55bf568e753121abc8759e): Bind for 0.0.0.0:38763 failed: port is already allocated
```

I believe this is due to the new debug_java_port introduced with this PR https://github.com/localstack/localstack/pull/1523

With this change, you are setting the port in the constructor by using a method known to have a race condition (https://github.com/localstack/localstack/blob/master/localstack/utils/common.py#L354)
(https://gist.github.com/gabrielfalcao/20e567e188f588b65ba2)

This should be changed to ensure unique ports are being issued across all lambdas


""" A context manager that captures stdout/stderr of the current thread. Use it as follows:
        with CaptureOutput() as c:
            ...
        print(c.stdout(), c.stderr())
    """
    orig_stdout = sys.stdout
    orig_stderr = sys.stderr
    orig___stdout = sys.__stdout__
    orig___stderr = sys.__stderr__
    CONTEXTS_BY_THREAD = {}
    class LogStreamIO(io.StringIO):
        def write(self, s):
            if isinstance(s, str) and hasattr(s, 'decode'):
                s = s.decode('unicode-escape')
            return super(CaptureOutput.LogStreamIO, self).write(s)
    def __init__(self):
        self._stdout = self.LogStreamIO()
        self._stderr = self.LogStreamIO()
    def __enter__(self):
        
        from werkzeug.local import LocalProxy
        ident = self._ident()
        if ident not in self.CONTEXTS_BY_THREAD:
            self.CONTEXTS_BY_THREAD[ident] = self
            self._set(LocalProxy(self._proxy(sys.stdout, 'stdout')),
                      LocalProxy(self._proxy(sys.stderr, 'stderr')),
                      LocalProxy(self._proxy(sys.__stdout__, 'stdout')),
                      LocalProxy(self._proxy(sys.__stderr__, 'stderr')))
        return self
    def __exit__(self, type, value, traceback):