pgcrypto: implement gen_random_uuid

(cherry picked from commit d8c5058b8c9ff412cd397983ae690d84702de5ec)