Minor optimization of getEvent and peekEvent

Now, we only take the bufferLock once per read
Attempt to read from descriptor optimistically
Fixed racey buffer operations that needed a lock
Immediately retry read on EINTR instead of waiting