ACT-1418 Unit tests and suggested fix for NPE on uncaught boundary error event

Work done at Hackergarten Vienna together with Rafael Cordones-Marcos
@rafacm and Florian Pirchner @florianpirchner
Merge branch 'ACT-1418' of github.com:pebrc/Activiti into ACT-1418