Extract shared code in RAIL channel

This patch starts a code mutualisation for a RAIL server-side
implementation. The file rail_common.c contains code that is shared
by both client and server.
Merge pull request #1447 from hardening/server-side-rail

Extract shared code in RAIL channel