Better read() semantics, write() support

Now instead of read() filling in whether the other process has released
the reference to the transactfd, it now returns 0 to signal that the
file is now closed. This allows to fill in a shared value that the other
process can modify by using write().