[U-Boot] [PATCH v5 03/20] env: Consolidate common code in hsearch_r()