Grigor Dimitrov survives a tense Bastad opener that nearly unraveled