fix broken mutex usage in ioctl