Sampling of photon statistics and density matrix using homodyne detection