Fixed coverity issues 1147702, 752782 and 752780. These were
cases were a function had a mutex locked but had a place
where the function exited without unlocking. TRQ-2424