fix polymorphicName var scope

see https://github.com/strongloop/loopback-datasource-juggler/issues/271

Signed-off-by: Clark Wang <clark.wangs@gmail.com>