Ringbuffer fix

Test flown by Tridge and reviewed by PX4dev, this is therefore a one-man-merge-show.