<!-- 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


try:
        out = to_str(subprocess.check_output('uname -a', shell=True))
        return 'Linux' in out
    except subprocess.CalledProcessError:
        return False
def short_uid():
    return str(uuid.uuid4())[0:8]
def json_safe(item):
    """ return a copy of the given object (e.g., dict) that is safe for JSON dumping """
    try:
        return json.loads(json.dumps(item, cls=CustomEncoder))
    except Exception:
        item = fix_json_keys(item)
        return json.loads(json.dumps(item, cls=CustomEncoder))
def fix_json_keys(item):
    """ make sure the keys of a JSON are strings (not binary type or other) """
    item_copy = item
    if isinstance(item, list):
        item_copy = []
        for i in item:
            item_copy.append(fix_json_keys(i))
    if isinstance(item, dict):
        item_copy = {}
        for k, v in item.items():
            item_copy[to_str(k)] = fix_json_keys(v)
    return item_copy
def save_file(file, content, append=False):