Avoid importing pstats unless absolutely necessary.

It's packaged separately on Debian for licensing reasons, so may not be
available.