Roger Federer kept his composure to beat Germany's Philipp Kohlschreiber in three sets at the Dubai Tennis Championships.