The locus you consider is either empty, or equal to $B$.
This can be seen as follows. Line bundles on a fiber $F$ of $\pi $ are parameterized by $H^1(F,\mathscr{O}^*_F)$. This group fits into an exact sequence
$$H^1(F,\mathscr{O}_F) \rightarrow H^1(F,\mathscr{O}^*_F) \xrightarrow{\ c_1\ }H^2(F,\mathbb{Z})\xrightarrow{\ i\ }H^2(F, \mathscr{O}_F)\ .$$
I claim that a line bundle $M$ on $F$ admits a $n$-th root if and only if $c_1(M)$ is divisible by $n$ in $H^2(F,\mathbb{Z})$. Indeed, assume that $c_1(M)=n\alpha $ for some $\alpha $ in $H^2(F,\mathbb{Z})$; we have $i(\alpha )=0$ since $H^2(F,\mathscr{O}_F)$ is torsion-free, hence $\alpha =c_1(N)$ for some $N$ in $H^1(F,\mathscr{O}^*_F)$. Then $M\otimes N^{-n}$ has $c_1=0$, hence comes from a class in the vector space $H^1(F,\mathscr{O}_F) $, which is of course divisible by $n$.
Now assume first that $B$ is simply connected; then $R^2\pi _*\mathbb{Z}$ is the constant sheaf $B\times H^2(F,\mathbb{Z})$ on $B$, so if $c_1(L_{|F})$ is divisible by $n$, the same holds for $c_1(L)$ restricted to any fiber. In general, suppose that $L_{|X_b}$ admits a $n$-th root for some $b\in B$; for any $c\in B$ we can choose a path from $b$ to $c$ and cover it by simply connected open subsets, so that $L_{|X_c}$ admits a $n$-th root.