Canadian prime minister announces resignation, says 'internal battles' mean he 'cannot be the best option' in election