The omega deformation from string and M-theory