include command in spawn errors (fixes #3908)

factor to centralize
wrap child, make it aware of filename