make random_password securely random

(cherry picked from commit 27e18332d1b7bf900b8f99907927e4e577447552)