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

# Type of request: This is a ...
[x] bug report
[ ] feature request

# Detailed description
Simple Rust Lambda function got stuck in localstack.

## Expected behavior
Lambda works normally as it does in AWS.

## Actual behavior
Lambda can start, but it gets stuck as soon as it tries to read request.

Via `docker logs <container id>` I can see:
```
Started!
START RequestId: 8736a8ca-e1b1-151b-ec25-1d825d277d49 Version: $LATEST
```

# Steps to reproduce
## Command used to start LocalStack
```yaml
services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    ports:
      - "4566-4599:4566-4599"
      - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
      - SERVICES=${SERVICES- }
      - DEBUG=${DEBUG- }
      - DATA_DIR=${DATA_DIR- }
      - PORT_WEB_UI=${PORT_WEB_UI- }
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR- }
      - KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- }
      - DOCKER_HOST=unix:///var/run/docker.sock
      - HOST_TMP_FOLDER=${TMPDIR-/tmp/localstack}
      - HOSTNAME_EXTERNAL=xxx.lan
    volumes:
      - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
```

Then `docker-compose up`.

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)
```rust
use lambda_runtime::error::HandlerError;
use lambda_runtime::lambda;
use serde::{Deserialize, Serialize};
use std::error::Error;

#[derive(Deserialize, Debug, Clone)]
struct FooRequest {
    bar: String,
}

#[derive(Serialize, Clone)]
struct FooResponse {
    success: bool,
}

fn main() -> Result<(), Box<dyn Error>> {
    println!("Started!");

    lambda!(hello_world);

    Ok(())
}

fn hello_world(ev: FooRequest, _ctx: lambda_runtime::Context) -> Result<FooResponse, HandlerError> {
    println!("{:?}", ev);
    Ok(FooResponse { success: true })
}
```

```sh
$ cargo build --target=x86_64-unknown-linux-musl --release
$ cp target/x86_64-unknown-linux-musl/release/hello_world ./bootstrap
$ zip -j lambda.zip bootstrap
$ aws --endpoint-url http://xxx:4566 lambda create-function --function-name "helloworld" --handler "hello.world" --runtime provided.al2 \
    --zip-file fileb://./lambda.zip --role "" --environment Variables={RUST_BACKTRACE=1} \
    --timeout 30 --memory-size 512
$ aws --endpoint-url http://xxx:4566 lambda invoke --function-name helloworld --payload '{"bar":"bar"}' ./output.json
```

┆Issue is synchronized with this [Jira Bug](https://localstack.atlassian.net/browse/LOC-341) by [Unito](https://www.unito.io/learn-more)

environment['DOCKER_LAMBDA_USE_STDIN'] = '1'
        return event_body.encode()
    def prepare_execution(self, func_arn, env_vars, runtime, command, handler, lambda_cwd):
        entrypoint = ''
        if command:
            entrypoint = ' --entrypoint ""'
        else:
            command = '"%s"' % handler
        
        network = config.LAMBDA_DOCKER_NETWORK
        network_str = '--network="%s"' % network if network else ''
        if network == 'host':
            port = get_free_tcp_port()
            env_vars['DOCKER_LAMBDA_API_PORT'] = port
            env_vars['DOCKER_LAMBDA_RUNTIME_PORT'] = port
        dns = config.LAMBDA_DOCKER_DNS
        dns_str = '--dns="%s"' % dns if dns else ''
        env_vars_string = ' '.join(['-e {}="${}"'.format(k, k) for (k, v) in env_vars.items()])
        debug_docker_java_port = '-p {p}:{p}'.format(p=Util.debug_java_port) if Util.debug_java_port else ''
        docker_cmd = self._docker_cmd()
        docker_image = Util.docker_image_for_runtime(runtime)
        rm_flag = Util.get_docker_remove_flag()
        if config.LAMBDA_REMOTE_DOCKER:
            cmd = (
                'CONTAINER_ID="$(%s create -i'
                ' %s'