<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

# Type of request: This is a ...

[ X ] bug report
[ ] feature request

# Detailed description

On BatchWriteItem if items are throttled, we are expected to receive a list of `UnprocessedItems` in the response instead of HTTP 500

## Expected behavior

Receive HTTP 200 but with Unprocessed Items in the response: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html#DDB-BatchWriteItem-response-UnprocessedItems

## Actual behavior

Receive HTTP 500 ProvisionedThroughPutException. "All or nothing"

# Steps to reproduce

Start LocalStack with DynamoDb Service and "DYNAMODB_ERROR_PROBABILITY=1.0"

## Command used to start LocalStack

```
new LocalStackContainer(DockerImageName.parse("localstack/localstack:0.12.9"))
      .withEnv("DYNAMODB_ERROR_PROBABILITY", "1.0")
      .withServices(DYNAMODB)
```

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)

You can just Randomly generate a big list of objects (exceeding 1kb per batch) and check this behaviour


"""
    Returns True if running in a docker container, else False
    Ref. https://docs.docker.com/config/containers/runmetrics/#control-groups
    """
    if not os.path.exists('/proc/1/cgroup'):
        return False
    try:
        if any([
            os.path.exists('/sys/fs/cgroup/memory/docker/'),
            any(['docker-' in file_names for file_names in os.listdir('/sys/fs/cgroup/memory/system.slice')]),
            os.path.exists('/sys/fs/cgroup/docker/'),
            any(['docker-' in file_names for file_names in os.listdir('/sys/fs/cgroup/system.slice/')]),
        ]):
            return False
    except Exception:
        pass
    with open('/proc/1/cgroup', 'rt') as ifh:
        os_hostname = open('/etc/hostname', 'rt').read().strip()
        content = ifh.read()
        if os_hostname in content or 'docker' in content:
            return True
    return False
is_in_docker = in_docker()
is_in_linux = is_linux()
if not DOCKER_BRIDGE_IP:
    DOCKER_BRIDGE_IP = '172.17.0.1'
    if is_in_docker:
        candidates = (DOCKER_BRIDGE_IP, '172.18.0.1')