Apple 'nearly axed' iPhone because of 'ear dialing' problem