While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
LAMBDA_RUNTIME_JAVA8,
    LAMBDA_RUNTIME_JAVA8_AL2,
    LAMBDA_RUNTIME_JAVA11,
    LAMBDA_RUNTIME_NODEJS12X,
    LAMBDA_RUNTIME_NODEJS14X,
    LAMBDA_RUNTIME_NODEJS16X,
    LAMBDA_RUNTIME_PROVIDED,
    LAMBDA_RUNTIME_PROVIDED_AL2,
    LAMBDA_RUNTIME_PYTHON36,
    LAMBDA_RUNTIME_PYTHON37,
    LAMBDA_RUNTIME_PYTHON38,
    LAMBDA_RUNTIME_PYTHON39,
    LAMBDA_RUNTIME_RUBY27,
)
from localstack.services.install import (
    GO_RUNTIME_VERSION,
    INSTALL_PATH_LOCALSTACK_FAT_JAR,
    TEST_LAMBDA_JAVA,
    download_and_extract,
)
from localstack.utils import testutil
from localstack.utils.aws import aws_stack
from localstack.utils.common import (
    cp_r,
    get_arch,
    get_os,
    load_file,
    mkdir,
    new_tmp_dir,
    retry,