Prevent infinite loop when HashMap is empty and values() method is called

Fixes issue: http://youtrack.jetbrains.com/issue/KT-3035