fix dequeue for empty

`dequeue` is assumed to return `0` when no queue exist. But now it returns `nil`.