fix undefined behavior warnings

In ANSI C, the behavior of the multiple side-effects to a same object(data)
in single sentence is undefined.
fix bug(num_writes is never under zero because it is unsigned value)

success and failure of apr_file_write should be judged by its return value
Merge pull request #5 from cubicdaiya/issues/invalid_comparison

bug(num_writes is never under zero because it is unsigned value)
Merge pull request #4 from cubicdaiya/issues/undefined_behavior

undefined behavior warnings