Added check for ongoing CouchPotato library scan. Improved shutdown check.