Add the machinery for the right sphinx glossary ids

Clone the docutils.nodes.make_id function and use
it to make the proper id when pointing to a glossary
term.

Change-Id: I9689e56e7c9f5201d7ab3d2e010abb557447aebb