Fix termination of parameters registry key handle on service exceptions