Apple has released a software update for iPhone, iPad and Mac users as it urges people to install it to protect devices.