[bugfix] [linux] don't destroy locks if count > 0

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>