This is a Docker for Mac on Apple Silicon issue, not a mysql_async problem.
Testing the same setup on a native Linux machine shows all tests pass perfectly. The Os { code: 22, kind: InvalidInput }
error appears to be caused by networking incompatibilities in Docker Desktop's virtualization layer on Apple Silicon, even when building linux/amd64 containers.
Having said that, if anyone knows of a workaround to allow Apple Silicon to succeed, I'd be very interested.