Raith ended their four-match Scottish First Division winless streak with a 1-0 victory at Hamilton, thanks to Allan Walker's first-half strike.