Fix a crash with mixed case models

The sails.models object keys are lower case, and Reference Model may be
mixed case
Merge pull request #1454 from moranje/master

Fix a crash with mixed case models