[SYNCOPE-555] check for id != 0 in *Controller.resolveReference()

git-svn-id: https://svn.apache.org/repos/asf/syncope/branches/1_1_X@1628373 13f79535-47bb-0310-9956-ffa450edef68
[SYNCOPE-555] Merge from 1_1_X

git-svn-id: https://svn.apache.org/repos/asf/syncope/branches/1_2_X@1628379 13f79535-47bb-0310-9956-ffa450edef68