Exact solution of the Hu-Paz-Zhang master equation