Patch for beefsack/go-astar Issue 1, moving goal condition check in astar.go to preserve optimality