Change sync fs calls to use assert style return values and errors

Start to #52