clover: clGetProgramInfo support for OpenCL 1.2.

[ Francisco Jerez: Rework using fold() for conciseness. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: EdB <edb+mesa@sigluy.net>
clover/util: Implement minimalist reference to clover::ref_counter object.

Tested-by: EdB <edb+mesa@sigluy.net>
clover/util: Pass initial count value to ref_counter constructor.

And mark the ref_count() method as const.

Tested-by: EdB <edb+mesa@sigluy.net>
clover: Refuse to build a program if there are kernel objects attached to it.

Fixes piglit cl-api-build-program.

Tested-by: EdB <edb+mesa@sigluy.net>