Fix Resource.initBuffer types.

initBuffer and initBufferKey didn't work with the ProgramCache variant
as their types hadn't been generalized.