Fixes #3202: change check on inventory from post to pre unmarshal, add a check about MACHINEID existence