Apple posted earnings and revenue below expectations, including missed estimates for iPhone and Mac products, sending shares down in extended trading.