Plugins: Remove use of RAND_MAX