Handle doc switch during Live Preview startup

This is for Brackets 1.0 Milestone issues #5110 and #4615.