Fixed SEC-2245. Cast to interface instead of implementation.

Makes our life easier when we want to override the MethodSecurityExpressionRoot.