Move sqlite3.c compilation earlier.

This speeds up parallel Make execution.
Add missing headers for Darwin.
Organize system dependent defines.
Fix errors in stat/statfs handling.

    o COPY_CSTAT macro had a bug where it could not be used as a statement, e.g.
        if (...)
            COPY_CSTAT(...);
    o Unify statfs copying behavior into a macro like with COPY_CSTAT.
    o Rename COPY_* for clarity.
    o Use consistent names for stat buffer names (info and linfo).
Correct behavior of stat/stafs on Chirp LFS.

* ccl/pull/427/head:
  Fix errors in stat/statfs handling.
  Organize system dependent defines.
  Add missing headers for Darwin.
wq_graph fix: Correct variable in error message when file not found
Function to count inuse in place
Count inuse (allocated) in place
fix: use allocated in worker to check task fit
fix: add committed, not inuse
Use *.inuse instead of *.allocated