isl_pw_*_on_shared_domain: improve error handling