Optimal Sketching for Trace Estimation