Create output directory before writing reference result.
Create output directory before writing reference result.

This may fix #716.

diku-dk/futhark,HIPERFIT/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark