Separated function linkAndValidateProgram() into linkProgram() and validateProgram().