BUG: Return type changed in percentile for higher precision `q`

gh-29105 incorrectly and unintentionally changed the return type for some percentile operations:

np.percentile(np.ones(10, dtype="float32"), np.float64(3))

should have the q float64 ensure a float64 result type, but doesn't on account of incorrectly assuming that the arrays dtype trumps the result one in the old code.
The part pertaining to using a higher precision internally for q itself should be fine though.

Originally posted by @seberg in #29105 (comment)