Update copyright; switch to semver
Update rebar URL
write: return number of bytes for partial writes

Handle the case where write(2) is not able to write out the complete
buffer. I would expect a partial write to be an exceptional condition
and the code should crash (by matching against the 'ok' atom). My guess
is that, instead of a partial write, the write will succeed and the next
call to write will return -1 and set errno.

The special case of 0 bytes written is not handled since we are not
dealing with regular files (0 bytes can mean errno is set).