set headers written by writeHead before emitting 'header'. closes #683