lib/util: add generate_random_machine_password() function