I write C(a,b) for a!/(b!(a-b)!) for each pair of integers with a>=b.
Suppose first that p was fixed. There are C(2n,n) scenarios in which you get n heads, and so the probability of getting exactly n heads is C(2n,n)p^n(1-p)^n.
Now, since p is extraded in [0,1] uniformly at random, the requested probability is the integral from 0 to 1 of C(2n,n)p^n(1-p)^n dp.
Now, let's compute the integral of p^n(1-p)^n dp between 0 and 1.
By parts, one has that, for a,b positive integers,
\int_0^1[p^a(1-p)^b dp]=
=[p^(a+1)/(a+1)(1-p)^b]|_0^1+\int_0^1[p^(a+1)/(a+1)(1-p)^(b-1)b dp]=
=\int_0^1[p^(a+1)(1-p)^(b-1) dp]b/(a+1)
So, by using this expression n times, one gets that
\int_0^1[p^n(1-p)^n dp]=(n/(n+1))*((n-1)/(n+2))*...*(1/2n)*\int_0^1[p^(2n)dp]
=n!/((2n)!/n!)*(1/(2n+1))=n!^2/(2n+1)!
And so in conclusion the requested probability is
C(2n,n)n!^2/(2n+1)!=((2n)!n!^2)/(n!*n!*(2n+1)!)=