remove foreground event listener when GLProgramState is deleted