Hearts manager Gary Locke praised his players after they delayed relegation when Jamie Hamill's late penalty earned them a 1-1 draw with Aberdeen.