Appell's function $F_4$ and the Bailey-Brafman identity