Good find, overlooked that one. Line 138: f.write('\ntask ' + task + ' energy\n') can be commented out though as NWChem will do an energy calculation before a gradient anyway.
The problem may be with https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/calculators/nwchem.py which
(due to the fact that is very experimental) does not extract forces by default.
In order for ASE optimizers to work you would have to uncomment (as for ASE revision 2476) the lines 137:
# f.write('\ntask ' + task + ' gradient\n')
and 148:
# self.read_forces()