Two-dimensional transverse coherence measurement of hard-x-ray beams using near-field speckle