Role of spatial averaging in the precision of gene expression patterns