Gloo: fixed bug that Program and Shadre could not be "re-created"

Also fix a test