Added hasSolution() method

As the title declares, I have added a method to check whether a certain
task has a solution or not. This could be useful in situations where the
solution is changed in another thread. (Also can be used as a safety
precaution)