High-resolution X-ray imaging and spectroscopy of the core of NGC 4945 with XMM-Newton and Chandra