Add static_asserts to ensure that the assumptions hold.

Inside the *Codec code certain assumptions with regards to the size
of char, short and int are made. Previously, these assumptions were
only stated in comments. Now, they are also statically asserted.