pds_core: fix mutex double unlock in error path