Enable sharing Pack.c between RTS and library

Using a PP flag LIBRARY_CODE, the code of Pack.c is split up into
parts necessary for the library and parts required for the RTS
(negation of LIBRARY_CODE); the rest is shared code.