Senior officer apologises in Kerala HC in contempt plea