ptserver: Tidy malloc handling in readpwd