OSOM: A simultaneously optimal algorithm for multi-armed and linear contextual bandits