profiles/internal/naming/namespace: fix globbing against a leaf server's root

Joint debugging with rthellend@

In the special case where we call Glob against a name that is the address of a
(non-mounttable) server, it hangs: the reason is that we read the first task off
the queue, consume it, don't add any new tasks (because we 'continue' before
reaching 'go ns.globAtServer') and then we're stuck waiting on an empty channel.

The fix is to always check that there's at least one inflight task before
attempting a read from the results channel. To make it work for the base case,
treat the first task as an 'in-flight' task (essentially, a sentinel). Also
simplify the code a bit by removing the needless select statement.

Change-Id: Ifc948a91462a0e51fa20393b2dc08ec474032e56
1 file changed