Use proper glib random functions where appropriate.

Since we're using g_rand*, we might as well use the proper functions
for what we're trying to do...