pgcrypto: implement gen_random_uuid

(cherry picked from commit 522fef9c3739d4c4f3c107e574e84db67a0c07a2)