Checks sockets when releasing, supports multiple lock types