Modify barrier ID logic to use ImplicitCastExpr

This commit reimplements the logic for constructing explicit casts of
the barrier/notify/wait ID.  The logic now uses the ImplicitCastExpr
supplied by clangupc, if any, to decide which casts(s) to insert.

The net (non-comment) source line count is unchanged.