432901 ensure a single onError callback only in pending and unready states

(cherry picked from commit 87c5b30d1cc4f878c44f089a4b3d05aaa121bbad)
432901 ensure a single onError callback only in pending and unready states

(cherry picked from commit eade9a3d25d9837dc391e18fd02b55516731422e)