Posix locking writing tuples

Writes result tuples in binary into a single file using posix locks.
Fixes previous writing tuples for large amounts of results.
TODO: instead of write_locked_range writing the entire array at once, use MaterializedTuple.toOstream. Get an `ostream` from the `fd`