[PATCH v2 1/2] stdio: Introduce stdio_valid()