Role security identity fix

Casting the role property in the constructor is necessary to
let the equals function binary comparison work properly while
using a custom role entity.

The security identity retrieval strategy getSecurityIdentities
function instantiates the role security identity class passing an
object. The constructor will assign this object to $this->role in case it's not an instance of Role. Binary safe comparison will fail even though gettype returns "string". The custom role entity requires a __toString magic method in this case.