ninjabackend: avoid lambdas
ninjabackend: avoid lambdas

The lambda in NinjaBuildElement.write is quite expensive, totalling 0.3s
just to do a couple function calls.  Since it is used just once, simply
inline it.

On a QEMU build, the total time spent in write from this series goes from
5.321s to 3.238s, though part of it can be attributed to previous patches.

mesonbuild/meson,pexip/meson,mesonbuild/meson,jpakkane/meson,jpakkane/meson,pexip/meson,jpakkane/meson,jpakkane/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,QuLogic/meson,QuLogic/meson,pexip/meson,jpakkane/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,QuLogic/meson,pexip/meson,QuLogic/meson,QuLogic/meson,QuLogic/meson,QuLogic/meson,jpakkane/meson,pexip/meson,jpakkane/meson,mesonbuild/meson,jpakkane/meson,jpakkane/meson,QuLogic/meson,pexip/meson,QuLogic/meson,pexip/meson,pexip/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson