[NamedPipe] Apply the optional GLibMainContext for the timer.

The event handlers of the pipes and the timer have to be invoked
on the same context to avoid race.