A general and efficient method for estimating continuous IBD functions for use in genome scans for QTL