Diffraction-limited imaging in a scanning transmission x-ray microscope