lib:replace: Check if HAVE_DECL_ENVIRON is defined first