Iceland was denied a famous victory at Euro 2016 after a late own goal all-but secured Hungary passage to the last 16.