Support compile time assert

While the error may be confusing, a confusing error is still better than
no error.
Add macro to do compile time checks on the ringbuf buffer sizes.