fix emit() behavior to return false if an error occurred; fix testReconnectAfterBufferFull() to flush at the end, rather then emit a new event and then flush