JQuery 1.9 data() sometimes returns null instead of undefined