Clean up libglvnd state on library unload and after a fork has been detected

The following patch set implements some previously missing teardown paths which eliminate resource leaks when libGLX is unloaded by the application.