libstdcl: fixed bug with more than 3 devices overrruning memd struct