Refinements of the Cauchy-Bunyakovsky-Schwarz Inequality for Functions of Selfadjoint Operators in Hilbert Spaces