Invalid memory reference

Partitial reversal of commit 16143b0fa392d89edb42a30651c369def4a63c37
bug 403
select/serial fix for GRES with topology

Does optimization of resource allocation for GRES with topology
Similar to changes already added to select/cons_res.
bug 410