Only commit the ZIL once in zpl_writepages() (msync() case)

This is a fix for issue #1849, as well as a cleaner fix for issue #907. See the individual commit description for details about the implementation.

Before:

    msync(         1 bytes)      0.035 seconds
    msync(         2 bytes)      0.027 seconds
    msync(         4 bytes)      0.009 seconds
    msync(         8 bytes)      0.011 seconds
    msync(        16 bytes)      0.014 seconds
    msync(        32 bytes)      0.009 seconds
    msync(        64 bytes)      0.011 seconds
    msync(       128 bytes)      0.014 seconds
    msync(       256 bytes)      0.009 seconds
    msync(       512 bytes)      0.011 seconds
    msync(      1024 bytes)      0.014 seconds
    msync(      2048 bytes)      0.009 seconds
    msync(      4096 bytes)      0.011 seconds
    msync(      8192 bytes)      0.023 seconds
    msync(     16384 bytes)      0.045 seconds
    msync(     32768 bytes)      0.092 seconds
    msync(     65536 bytes)      0.183 seconds
    msync(    131072 bytes)      0.378 seconds
    msync(    262144 bytes)      0.583 seconds
    msync(    524288 bytes)      1.413 seconds
    msync(   1048576 bytes)      3.105 seconds
    msync(   2097152 bytes)      6.242 seconds
    msync(   4194304 bytes)     12.117 seconds
    msync(   8388608 bytes)     10.331 seconds
    msync(  16777216 bytes)     34.966 seconds
    msync(  33554432 bytes)     34.901 seconds

After:

    msync(         1 bytes)      0.003 seconds
    msync(         2 bytes)      0.003 seconds
    msync(         4 bytes)      0.004 seconds
    msync(         8 bytes)      0.003 seconds
    msync(        16 bytes)      0.003 seconds
    msync(        32 bytes)      0.004 seconds
    msync(        64 bytes)      0.003 seconds
    msync(       128 bytes)      0.003 seconds
    msync(       256 bytes)      0.003 seconds
    msync(       512 bytes)      0.003 seconds
    msync(      1024 bytes)      0.003 seconds
    msync(      2048 bytes)      0.002 seconds
    msync(      4096 bytes)      0.002 seconds
    msync(      8192 bytes)      0.002 seconds
    msync(     16384 bytes)      0.003 seconds
    msync(     32768 bytes)      0.003 seconds
    msync(     65536 bytes)      0.003 seconds
    msync(    131072 bytes)      0.003 seconds
    msync(    262144 bytes)      0.006 seconds
    msync(    524288 bytes)      0.007 seconds
    msync(   1048576 bytes)      0.009 seconds
    msync(   2097152 bytes)      0.017 seconds
    msync(   4194304 bytes)      0.035 seconds
    msync(   8388608 bytes)      0.064 seconds
    msync(  16777216 bytes)      0.641 seconds
    msync(  33554432 bytes)      0.250 seconds

And now `aptitude` is much faster. Yay!