Apple quarterly profit nearly doubles to $21.7 bn