check BGZF writer errcode before finishing