Fixed flush()

Flush was changed to wait until the ring buffer is empty and to wait for the final frame to have been transmitted before being complete.

or:

flush()
    wait for ring buffer to empty;
    wait for final frame to be transmitted;
    unset transmitting;
Merge pull request #138 from Mike43110/master

Changed flush() to flush all bytes in buffer