Afghan president and rival strike power-sharing deal after months of feuding