Move `DexOutput` ref check earlier
Move `DexOutput` ref check earlier

Summary: Do not generate data into a buffer that might be too small.

Reviewed By: ssj933

Differential Revision: D23249062

fbshipit-source-id: ab2068291239c05e0e840af3f089ec27fe90e43d

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex