TreadPool returning result

Added new template method for thread pool tasks.
ThreadPool now can return result, e.g. checksum.