Add .fail handlers to all $.when calls