Bugfixes and code improvements

- Removed dependency on stat.c (removed previously)
- Fixed return value handling of fsync and fdatasync
- Used macros where possible
- Fast mutexes used by default
- Debug logging disabled by default