Generating a Gray code for prefix normal words in amortized polylogarithmic time per word