[U-Boot] [PATCH v5 06/30] env: common: Factor out the common env_valid check