Linear-Time In-Place DFS and BFS in the Restore Model