JBPM-3916 - Keeping multi instance node (instance) ids consistent

See https://issues.jboss.org/browse/JBPM-3916

Contains a test and fix for the issue.