A global existence result for the semigeostrophic equations in three dimensional convex domains