Update SearchMaze.java

Just a small optimization. Insert into the list only if there exists a valid path. Please let me know if i am wrong.

Thank you for the EPI book.

Cheers,
Vikram