Comparison of performance of van der Waals-corrected exchange-correlation functionals for interlayer interaction in graphene and hexagonal boron nitride