A high-precision method to measure thermal conductivity of solids using reversible heat flux