Move optional traits to the cocaine::io namespace.

Type traits belong to the cocaine::io namespace, so move them there.
This resolves failing build due to 'detail' namespace conflicts.