Fix nimprof import error when --threads:on.

Currently nimprof fails to import locks when --threads:on, resulting in the following error:
`lib/pure/nimprof.nim(64, 19) Error: undeclared identifier: 'TLock'`

This imports locks if the `when withThreads` block is compiled.