Fix compilation of library/version_array.m in memory profiling grades.

library/version_array.m:
    The macro MR_ALLOC_ID is only defined for foreign_proc pragmas *not* for
    foreign_code pragmas.  Commit ab44bba introduced several references to
    MR_ALLOC_ID inside functions defined foreign_code pragmas.  Fix this by
    passing the appropriate alloc id down from the foreign_proc pragmas
    that call the affected functions.