Set resize handler before doing any async IO.