Fix mutex lock and device reference output on monitor