Fix module.run state for non-dict return data

This backports part of a fix for this that is already in the 2014.7 branch,
properly handling execution module functions which return non-dict data.