Disentangling dark energy and cosmic tests of gravity from weak lensing systematics