Add a timeout decorator for timing out functions that may hang

Fixes #6891
Merge pull request #6900 from jimi-c/issue_6891_cifs_mount_hang

Add a timeout decorator for timing out functions that may hang