linux-generic: tm: handle pktout queue check properly
linux-generic: tm: handle pktout queue check properly

Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2458 by only checking
for a proper pktout_queue count if the egress_kind is ODP_TM_EGRESS_PKT_IO.

This check is also moved before locking and allocating a tm_system struct
to avoid deadlocks and memory leaks that were another side-effect of this
bug.

Signed-off-by: Bill Fischofer <52f3c909d51cc5d355a68a403df6906b3c1a8f83@linaro.org>
Tested-and-reviewed-by: Mike Holmes <ed44c09f4d7f698f5510adc894a872c73e08c8bd@linaro.org>
Signed-off-by: Maxim Uvarov <db4d16e02ae2d7493db430203537da8b2e34f290@linaro.org>

nmorey/odp,ravineet-singh/odp,ravineet-singh/odp,nmorey/odp,dkrot/odp,mike-holmes-linaro/odp,mike-holmes-linaro/odp,erachmi/odp,mike-holmes-linaro/odp,nmorey/odp,dkrot/odp,ravineet-singh/odp,mike-holmes-linaro/odp,erachmi/odp,erachmi/odp,dkrot/odp,dkrot/odp,nmorey/odp,erachmi/odp,ravineet-singh/odp