Pure injective envelopes of finite length modules over a generalized Weyl algebra