Issue with create_transfer_matrix

I have been making use of the PETScDMCollection.create_transfer_matrix() for sometime and have had success. I am seeing issues today though and so created the following simple code (MWE) where I am able to recreate the issue.

import dolfin as dl
# create the coarse mesh
nx_coarse = 5
mesh_coarse = dl.UnitSquareMesh(nx_coarse, nx_coarse)

# create the fine mesh
mesh_fine   = dl.refine(mesh_coarse)

# store all meshes
meshes = [mesh_coarse, mesh_fine]
num_of_meshes = len(meshes)

# define finite-element spaces on each of the meshes
P1s  = [dl.FiniteElement("CG", meshes[i].ufl_cell(), 1) \
        for i in range(num_of_meshes)]
Vhs  = [dl.FunctionSpace(meshes[i], P1s[i]) \
        for i in range(num_of_meshes)]

# create-transfer matrix
P    = dl.PETScDMCollection.create_transfer_matrix(Vhs[0], Vhs[1])

Upon running this code I receive the error message

PETSC ERROR: Logging has not been enabled.
You might have forgotten to call PetscInitialize().
application called MPI_Abort(MPI_COMM_WORLD, 70033056) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=70033056
:
system msg for write_line failure : Bad file descriptor
Error in system call pthread_mutex_destroy: Device or resource busy
    src/mpi/init/initthread.c:284

I am using dolfin version 2019.1.0 which was installed using conda. Any tips would be greatly appreciated!

This is a bit of an ugly workaround, but assemble-ing a vector seems to carry out whatever initialization step is needed, e.g.,

import dolfin as dl
# create the coarse mesh
nx_coarse = 5
mesh_coarse = dl.UnitSquareMesh(nx_coarse, nx_coarse)

####### Workaround #######
dl.assemble(dl.TestFunction(dl.FunctionSpace(mesh_coarse,"CG",1))*dl.dx)
##########################

# create the fine mesh
mesh_fine   = dl.refine(mesh_coarse)

# ...

Great, that does work! I now see that there are internal functions which initialize various sub components of FEniCS. This explains why my larger code did not throw the same error as it had similar assemble calls.